Improving Parabola: 8 Simple Theme Tweaks — Introduction

Parabola by Cryout Creations is a pretty great theme right out of the box. It’s flexible, user-friendly, responsive, and stylish. I gush all about Parabola’s awesomeness in my Overview and Comparison of Three Free WordPress Themes: Atahualpa, Graphene, and Parabola. So clearly, improving Parabola certainly isn’t a must, but there are a few things this WordPress theme could do a little better. Thankfully, these are all easy to fix.

While improving Parabola isn’t tough, there is some meddling to do in the php files. A note of caution to anyone who wants to implement these tactics for improving Parabola. If you’re not using a child theme, you will lose any changes you make during the next theme update, so make sure to keep track of all your modifications and make backups of your revised php files. I don’t use a child theme yet since I’d previously made very few php changes, but after this round of improving Parabola, it’s the next thing on my to-do list. For now, I keep track of all php modifications in a .txt file and it only takes me a few minutes to apply them each time there’s a new version of the theme.

Update: I no longer use Parabola, so I don’t know what changes have been made to the theme since I wrote this…
Advertisement:

#1: Improving Parabola’s Category and Tag Pages

It’s always good to have a little introduction text at the top of archive pages, particularly for SEO purposes, but also to give readers a hint of what to expect as they browse. If you’d like to include some automatically generated text below category and tag page titles, then follow these steps.

From your WordPress Dashboard, go to Appearance then Editor, open the category.php file, and find this:

<h1 class="page-title"><?php
 printf( __( 'Category Archives: %s', 'parabola' ), '<span>' . single_tag_title( '', false ) . '</span>' );
 ?></h1>
Replace it with this:

<h1 class="entry-title"><?php printf( __( 'Category Archives: %s', 'parabola' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>

<h1 class="page-title"><?php
printf( __( 'Browse the following posts about %s.', 'parabola' ), '<span>' . single_cat_title( '', false ) . '</span>' );
?></h1>
After saving your changes, open the tag.php file and find this:

<h1 class="page-title"><?php
printf( __( 'Topic Archives: %s', 'parabola' ), '<span>' . single_tag_title( '', false ) . '</span>' );
?></h1>

Replace it with this new code:

<h1 class="entry-title"><?php printf( __( 'Tag Archives: %s', 'parabola' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>

<h1 class="page-title"><?php
printf( __( 'Browse the following posts about %s.', 'parabola' ), '<span>' . single_cat_title( '', false ) . '</span>' );
?></h1>

Ta da! The first step to improving Parabola is now complete. Reload your website to check out how it looks.

#2: Improving Parabola’s Search Results Page

You may have noticed that Parabola’s display of the search results page is a little inconsistent with the rest of the site, especially if you’re using category and/or tag descriptions. If you’re like me and you prefer more consistency throughout your website, try improving Parabola with these two modifications.

From the Editor, open the search.php file and find this:

<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'parabola' ); ?></h1>
</header><!-- .entry-header -->
<h4><?php printf( __( 'No search results for: %s.', 'parabola' ), '<span>' . get_search_query() . '</span>' ); ?></h4>
Advertisement: Memories of a Carnivore: Adventures in Eating Ethically, by Julie Dupuis. Raw. Irreverant. Humorous. Fragmented. Download now for only $1.99.
Replace it with:

<h1 class="entry-title"><?php _e( 'Nothing Found', 'parabola' ); ?></h1>
<h1 class="page-title"><?php printf( __( 'No search results for %s.', 'parabola' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
<br><p><?php printf( __( 'Try again, or browse the menus above to help you on your way.', 'parabola' ), '<span>' . get_search_query() . '</span>' ); ?></p>

You can change the text to read whatever you like. For example, I encourage users to browse other options below the search bar. That’s because I’ve added a new widget area to the file, which is how I’ve added custom content like a “Best of” posts grid and a tag cloud. (I got the idea for this from Solving Not Found Issues with Atahualpa. However, the method is different with Parabola. If you’re interested in finding out how to add new widget areas when improving Parabola, then read on!)

Advertisement:
Once you’ve finished reworking the text, in the same file, scroll back up to find the following code snippet:

<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'parabola' ), '<span>' . get_search_query() . '</span>' ); ?></h1>

And replace it with:

<h1 class="entry-title"><?php _e( 'Search Results', 'parabola' ); ?></h1>
<h1 class="page-title"><?php printf( __( 'Search results for %s', 'parabola' ), '<span>' . get_search_query() . '</span>' ); ?></h1>

Your Search Results and No Search Results page titles, subheadings, and introductory text will now be consistent in design and layout with category and tag archive pages, as well as the 404 Not Found page.

Announcement: Need help with a writing project? I can help! Check out my writing and editing service.

#3: Improving Parabola’s Blog Page

So while we’re making the appearance of different page types more consistent site-wide, we may as well take a look at the blog page, or the posts page. Not much is needed in the way of improving Parabola here, but you may want to add a page title. Especially if it isn’t your home page, it helps users figure out what they’re looking at.

To add a page title to the blog page, open up the templates/template-blog.php file from the WordPress Editor. Find this:

<?php cryout_before_content_hook(); ?>

Add the following code immediately afterwards:

<h1 class="entry-title"><?php _e( 'Latest Posts', 'parabola' ); ?></h1>

Change “Latest Posts” to whatever you like, and there you go! A page title for your blog page. Isn’t that nice?

Announcement: Like what you've been reading? Say Cheers with a cup of tea!

#4: Improving Parabola’s 404 Not Found Page

If you use the Below Content widget area that Parabola so conveniently includes, then you may find it a shame that the widget area isn’t visible on the 404 Not Found page. To make it appear, open the 404.php file via the Editor. Find the following code at the bottom of the file:

</div><!-- #content -->

Insert the following code immediately before it. Don’t place any extra line breaks between the two codes.

<?php cryout_after_content_hook(); ?>

And while you’re playing around in the 404 file, you may as well update the Not Found text. Find this:

<p><?php _e( 'Apologies, but the page you requested could not be found. Perhaps searching will help.', 'parabola' ); ?></p>

Then, change the text to read whatever you want. And as above with the search.php file, you can add a new widget area to make adding custom content really easy. If that sounds like something you want to try, then keep reading!

Once you’re ready, save the file, refresh your website, and voilà. You’re well on your way to improving Parabola now!

#5: Improving Parabola’s 404 and Search Results Not Found Pages

Ok, so you want to add a new widget area to Parabola to help you add custom content to the Search Results Not Found and 404 Not Found pages. I don’t blame you! It’s useful that Parabola already includes a search bar on these pages, but it could go a little further.

That, of course, will be different for everyone. As I mentioned above, I’ve chosen to display a “Best of” posts grid and a tag cloud, which should be more than enough, combined with the search bar and menus, to help site users figure out where they’re headed next.

So the first tip I’ll reveal is the easiest thing possible. I actually don’t use a custom widget area on the 404 Not Found page. I just use the Bottom Content widget area that comes built-in with Parabola. But first I had to follow tweak #4 above to make it visible on that page. And I use Widget Visibility, a Jetpack feature, to control where the widgets appear on the site. Easy-peasy!

Due to some very strange layout behaviour, the same thing wouldn’t work on the Search Results Not Found page, so that’s when I decided to register a new widget area. Here’s how I went about improving Parabola with a bit of custom content.

First, go to the Editor and open functions.php. At the very bottom of the file, paste the following code without leaving any blank lines above it:

<?php register_sidebar( array(
'name' => __( 'Search Results Not Found Widget Area' ),
'id' => 'search_results_not_found_widget_area',
'description' => __( 'Widgets in this area will appear below the search bar on the Search Results page only when there are no results.' ),
'before_title' => '<h1>',
'after_title' => '</h1>',
) );

Save the file, then open search.php and find this:

<div class="contentsearch">
<?php get_search_form(); ?></div>

Add this code snippet immediately afterwards:

<?php if ( dynamic_sidebar('search_results_not_found_widget_area') ) : else : endif; ?>

Save, then reload your site. You can now add widgets to your new widget area! Perform a front-end nonsense site search such as “lasgkalkg” to see it in action.

#6: Improving Parabola’s Breadcrumbs

It’s fantastic that Parabola comes preloaded with a breadcrumbs plugin, but it’s beyond me why it’s not on every page, or doesn’t work well on some pages. This, to me, is a must of improving Parabola which the theme developers should, in my opinion, take care of in a future update. So to include navigation breadcrumbs on the search results and 404 pages, try these adjustments.

From the Editor, open the theme-functions.php file and find this:

function parabola_breadcrumbs() {
$parabolas= parabola_get_theme_options();
foreach ($parabolas as $key => $value) { ${"$key"} = $value ; }
global $post;
if (is_page() && !is_front_page() || is_single() || is_category() || is_archive()) {
echo '<div class="breadcrumbs">';

Delete this snippet from the above code:

if (is_page() && !is_front_page() || is_single() || is_category() || is_archive()) {

And replace it with this snippet instead:

if (is_page() && !is_front_page() || is_single() || is_category() || is_search() || is_404() || is_archive()) {

Next, find this:

if (is_category()) {
$category = get_the_category();
echo ''.$category[0]->cat_name.'';
}

Add the following code immediately after the previous one:

if (is_search()) {
echo $before . 'Search Results: "' . get_search_query() . '"' . $after;
}

if (is_404()) {
echo $before . 'Page ' . 'Not Found' . '&nbsp;' . $after;
}

That was a little more convoluted than the other changes we’ve made so far, but it was worth it! Now your breadcrumbs are working site-wide!

(I am indebted to a Bloglow article for the help figuring this one out.)

Update: This tweak formerly included instructions on applying the code to tag pages as well, but the same day I published this post, Parabola released a new version which fixed the missing breadcrumbs from tag pages! I’ve therefore updated the code and explanations above to reflect the new Parabola version.

However, I didn’t like that the word “tag” is used as a base in the breadcrumbs for all tag terms. So, rather than toy with php or css code to be rid of it, I disabled Parabola’s breadcrumbs altogether. I use the WordPress SEO by Yoast plugin’s breadcrumbs feature on all my other sites, and since the options are so much more customisable, I made the switch here, too.

#7: Improving Parabola’s Next/Previous Post Links

I must admit that I like to make things easy for people. That’s why I’m surprised Parabola doesn’t offer any options regarding the placement of next/previous post links on single posts. It’s generally good practice to include these links both above and below a post, to help users navigate content more easily without having to scroll around so much. Yet, Parabola places the links at the bottom of posts, and that’s the end of it.

If you’d like to add next/previous post links above single posts as well, then open up single.php from the WordPress Editor. Find this:

<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>

Replace it with this:

<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

 <div id="nav-above" class="navigation">
 <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">&laquo;</span> %title' ); ?></div>
 <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">&raquo;</span>' ); ?></div>
 </div><!-- #nav-above -->

<h1 class="entry-title"><?php the_title(); ?></h1>

That’s it! You may need to add some CSS styling to get the right link colour or font size, for example, but that part of improving Parabola should be a breeze.

(Thanks to a LifeAtf8 article for putting me on the right track sorting this one out.)

#8: Improving Parabola by Registering a New Menu Location

Alright, this isn’t actually anything that will help with improving Parabola; it’s just something that might be useful to some people. Parabola comes with three menu locations, but let’s just say you need a fourth. Here’s how to get it the easy way (that is,  with the fewest file modifications possible).

Firstly, open theme-setup.php and find this:

register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'parabola' ),
'top' => __( 'Top Navigation', 'parabola' ),
'footer' => __( 'Footer Navigation', 'parabola' ),

Beneath, without adding any blank lines, add this:

'secondary' => __( 'Secondary Navigation', 'parabola' ),

Name the menu location whatever you like if “secondary” doesn’t suit your needs. Save, then go to Appearance then Widgets. You can use an Enhanced Text Widget to insert the following code, which will tell your new menu where to appear on your site:

<?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>

Don’t forget to change the menu name here if you’ve changed it above. As for placing your widget, I would suggest the Above or Below Content widget areas, which are horizontal. *Note that you may need to apply css styling to your new menu to make it look like the others on your site.

There! You’re all done improving Parabola, and you barely broke a sweat!

Conclusion

If you’ve got any more ideas for improving Parabola, please leave a comment below! It’s still a fairly new theme and there isn’t much information about it out there, so the more input, the better for everyone (smiley face).

And please let me know if you’ve got a better way of accomplishing any of the tweaks I’ve suggested for improving Parabola. I’m always happy to learn something new!

Likewise, let me know if you found my tweaks for improving Parabola useful. I’ll be flattered, and encouraged to write more posts like this one. Lol.