Genesis Author Pro plugin: How to move the book meta

Genesis Author Pro plugin

This post is a tutorial for customizing how the Genesis Author Pro plugin outputs it content. I’m going to dig into some light code, which may or may not be useful to you. If you’re not here for the geekery, you can safely skip this post. If you’re a creative entrepreneur who runs their own website, read on! And if you’re a pro who wants to skip ahead to the actual tutorial, scroll down to the Customizing the Genesis Author Pro plugin header

In my spare time, I’m a geek. I design, build, and customize websites, as well as market online the businesses those websites represent. This experience informs my view of why all artists are creative entrepreneurs. If you’re online, you gotta work it. But I digress.

My goals for my blog include sharing information that will help creatives take control of their online efforts. This means avoiding digital sharecropping and being 100% in control over your own website. My recommended method is to self-host your own install of WordPress. I’ll dig into the why in a future post. If you already use the Genesis Author Pro plugin, I hope you’ll find this useful.

What you need for this tutorial

  • a self-hosted WordPress site (ie not a WordPress.com site)
  • FTP access to your server, in order to modify various files
  • a WordPress theme built on the Genesis framework
  • the Genesis Author Pro plugin (installed & activated)
  • the Enhanced Text Widget plugin (installed & activated)

I favor the Genesis framework for WordPress. The framework is light (ie not heavy on resources, like page builders), SEO-friendly, and flexible. A lot of customizations are done via small snippets of code, instead of installing plugins whose features you may not need. More plugins = more resource use = slower websites. Genesis rocks, and you’ll need a Genesis theme to do this tutorial.

Got everything sorted? Cool – time to move on.

Customizing the Genesis Author Pro plugin

Note: everything you do to your own website is at your own risk. I’m happy to discuss this tutorial but I don’t have the time to support you if something goes wrong. But hey – fixing a problem is the best way to learn!

I wanted to add a reading recommendations section to my website. While there are other options, I chose the Genesis Author Pro plugin because it’s simple and it just plain works. Genesis plugins tend to be focused on features without bells and whistles.

The plugin is designed to work with their Author Pro theme (ref link), which is a cool niche idea. If you want to create a simple website focused on your books, with dedicated pages for each book, using the Author Pro theme and the Author Pro plugin is a great option.

Or you could be like me and use just the plugin on a Genesis theme of your choice.

But there are two things I don’t like about the plugin:

  1. Single books are displayed using a full width, no sidebar page template. If you use a sidebar that includes calls-to-action for your email list or stuff you sell, this is no good.
  2. Book details, like the cover, price, stats & links (aka book meta) take up 1/3 of the page. This really isn’t a problem, unless you fix #1, in which case it squeezes the actual content of the book page into a much smaller area.
genesis author pro plugin single book layout
The default single book view. Full width content, no sidebar.

By default, the single book page layout looks like the screenshot to the right. The content takes up the full width of the page, and there is no sidebar.

I need a sidebar. It’s where I put my most important call-to-action (CTA) – a subscription form to my mailing list. (Why this is important will be covered in a future post.) Without a sidebar, it reduces the chance that a visitor may subscribe to my list and they may leave my site without any chance of hearing from them again. That’s not a good thing when your goal is to build relationships with your fans.

Step 1: Adding a sidebar to the single books page

To add a sidebar to the single book page, we need to create a custom post template. This is what you need to do:

  1. Create a file in your Genesis theme folder called single-books.php.
  2. Add this to that file:
    <?php // Use the default site template for single books, instead of the custom one. remove_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); genesis();
  3. Add this snippet to the bottom of your theme’s functions.php file:
    add_post_type_support( 'books', 'genesis-layouts' );

Note: if you’ve never edited your functions.php file before, you should know that any mistakes, including the smallest typo, will break your site. Undoing your edit will bring your site back.

Single book view with the site sidebar added on my site, using the Breakthrough Pro theme.

On my site, where I keep my sidebar on the left (and yes, I have a reason for that), doing the above made my single book layout look like the screenshot to the right.

Not too bad but as you can see with my theme (Breakthrough Pro by StudioPress), the actual content is squished and there’s a ton of empty space below the book meta. Wouldn’t it be cool if we could move the book meta to the sidebar so the actual book content had more room?

Well – that’s totally possible. All we have to do is 1) add the book meta to a widget and 2)
remove the book meta from the content area .

Step 2: Display the book meta in a widget

Create an Enhanced Text widget in your sidebar widget region and add <?php
genesis_author_pro_book_details();
in the Content field:

You don’t need the Title or the CSS Class, those are optional. You do want to

  • Check Do not display the title. It’s clear that the output will be book meta, mainly due to the book cover. Adding a title is redundant.
  • Check Do not display empty widgets. There’s no need for the empty widget to display and take up space on non-book pages.

Once you save, refresh and you’ll see the widget in your sidebar (or whatever widget area you put it in). However the book meta will still appear on the right side of the single book page too.

Next is removing the the book meta from the right side of the page.

Step 3: Removing the default book meta

For this we need to modify the plugin – aka hack it. This means modifying the plugin directly, which is usually a no-no because customizations will be overwritten when a plugin is updated. However, this plugin hasn’t been updated in over 2 years and is a simple plugin that likely won’t be updated much, if at all.

You need to find and edit this file: /wp-content/plugins/genesis-author-pro/functions/template.php. On line 196 you’ll see this function:

function genesis_author_pro_single_content(){

	echo '<div class="one-third genesis-author-pro-book-details">';
	genesis_author_pro_book_details();
	echo '</div>';


	echo '<div class="two-thirds first genesis-author-pro-book-description">';
	the_content();
	echo '</div>';

	echo '<br class="clear" />';

}

Modify that function to this instead:

function genesis_author_pro_single_content(){

/**
 * 
 * REMOVING BOOK META
	echo '<div class="one-third genesis-author-pro-book-details">';
	genesis_author_pro_book_details();
	echo '</div>';
*/	

	echo '<div>';
	the_content();
	echo '</div>';

	echo '<br class="clear" />';

}

What the modification does is 1) hide the book meta without deleting it, and 2) remove the css classes that restrict the content to 2/3 of the available space.

The final result – book meta in the sidebar and single book content taking up the whole post area.

Once I made that edit and saved the file, my singe book page looked like the screenshot to the right – that’s exactly what I wanted!

Now, the book meta in the sidebar does push down my CTA but I’m ok with it. The book meta is more important on this page.

The only hitch is that on mobile devices, the sidebar appears below the content. Mobile visitors won’t see the book meta unless they scroll to the bottom of the page. This isn’t ideal but books are a small part of my site and it’s a trade-off that I can live with.

That’s it – you should have a better book page now!

Note: if the Genesis Author Pro plugin is ever updated, your mods will be lost!

In that case, just redo the tutorial.

The plugin hasn’t been updated in 2 years, so it’s unlikely to be updated again. It does what it’s supposed to do, simply and elegantly. The only update that might happen is if they decide to make it Gutenberg compatible (it still uses the classic WordPress editor) or if there’s a security flaw that needs to be fixed.

FYI WordPress won’t update a plugin if the existing version number is higher than the available update. So you could modify the plugin version number to prevent it being overwritten. However it’s safer to let it be updated.

Did you find this helpful? Did you improve on it? Let me know in the comments.

Got something to say?

This site uses Akismet to reduce spam. Learn how your comment data is processed.