Genesis and More Tag Issue

more tagI wanted to post this because I know there are others out there who may find themselves in the same predicament I did over the weekend. I upgraded a client that was using Studiopress Education Child Theme to Genesis 2.0. It sort of “broke” the front page. At the bottom of the home page is the loop. I had customized the loop (originally using the grid loop code and then grid loop fix by WP Smith to show a specific category. In this instance the Main Blog category.  Although I had originally used the grid loop my client decided he only wanted to use the two featured posts and not the “grid feature” I just changed the code to show that rather than changing the home.php file to a different kind of query.

Once I updated to Genesis 2.0.1 (from 1.9.2) the front page posts no longer stopped at the more tag the client  had set in the post. It worked fine on the blog page but not on the home page. (Client wanted control over where the articles showed “Read More” so in Genesis Theme settings I had it set to show content and the limit set to 0)

In my  hours long search for answers I came across the two part solution (each on a different site)  but wasn’t sure how to implement the more tag fix. I opened a ticket at Studiopress and had my fix by the end of the day thanks to Nick.

Here it is:

 

First I need to add that more tag info I found here to the home.php file:

function education_home_loop_helper() {

echo '<div id="home-featured">';

genesis_widget_area( 'slider', array(

'before' => '<div class="slider widget-area">'

) );

genesis_widget_area( 'intro', array(

'before' => '<div class="intro widget-area"><div class="inner">',
'after' => '<div class="clear"></div></div></div><!-- end .intro -->'

) );

genesis_widget_area( 'featured', array(

'before' => '<div class="featured widget-area"><div class="inner">',
'after' => '<div class="clear"></div></div></div><!-- end .featured -->'

) );

genesis_widget_area( 'call-to-action', array(

'before' => '<div class="call-to-action"><div class="banner-left"></div>',
'after' => '<div class="banner-right"></div></div><!-- end .call-to-action -->'

) );

echo '</div>';

global $more;
 $more = 0;

}

While I was at it I had found how to simplify my code to show my Main Blog category from Bill Erickson’s Article on Customizing the WordPress Query. This was also giving to me by Nick at Studiopress. Instead of exclude I changed it to include instead of exclude.

add_action( 'pre_get_posts', 'be_include_category_from_blog' );
/**
* Include Category from Blog
*
* @author Bill Erickson
* @editor Melanie Adcock
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/
function be_include_category_from_blog( $query ) {

if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'cat', '4' );
}

}

This went just above the ending genesis(); code.

Leave a Comment

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