Site logo

Archived topic

different frontpage layout

3 replies · Started by Patrick Flack on July 26, 2015

Viewing posts 1–4 of 4

Hi Tom,

Can I get the frontpage to have a content/sidebar/sidebar layout and the categories and archive pages to have sidebar/content/sidebar?

With the "blog sidebar layout" function in the customise menu, setting the frontpage as c/s/s also affects the category and archive pages - but i'd like them as s/c/s, like the single posts.

Thanks for your help and the great theme!

P.

Absolutely - you can target your homepage with a little PHP magic:

add_filter( 'generate_sidebar_layout','generate_custom_blog_sidebar_layout' );
function generate_custom_blog_sidebar_layout( $layout )
{
 	// If we are on the posts page, set the sidebar
 	if ( is_home() )
 	 	return 'both-right';

 	// Or else, set the regular layout
 	return $layout;

 }

Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/

Then your other areas (categories, archives) should take on the layout you have set with the Blog Layout option.

Let me know :)

Implemented in 5 seconds and worked an absolute treat, thanks a lot!

P.

You're welcome! :)

This archived topic is closed to new replies.