[Resolved] different frontpage layout

Home Forums Support [Resolved] different frontpage layout

Home Forums Support different frontpage layout

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #123881
    Patrick Flack

    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.

    #123953
    Tom
    Lead Developer
    Lead Developer

    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 ๐Ÿ™‚

    #124000
    Patrick Flack

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

    P.

    #124055
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! ๐Ÿ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.