Force Layout – Single Post – One Category

Community Forums Forums General Discussion Force Layout – Single Post – One Category

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  anitac 10 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #61056

    scotm
    Participant
    Post count: 35

    I’m trying to force the layout for single posts in one category. Trying this but it’s not preventing the full width from affecting all categories:

    // Force layout on video category single posts
    add_filter(‘genesis_pre_get_option_site_layout’, ‘be_category_layout’);
    function be_category_layout($opt) {
    if ( is_category(‘video’) || is_single() )
    $opt = ‘full-width-content’;
    return $opt;
    }

    #61062

    anitac
    Participant
    Post count: 7031

    Check out Brad Dalton’s post here to see if it can be of some help to you. I am still learning and value his tutorials very much – http://wpsites.net/web-design/change-layout-genesis/.


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #61064

    scotm
    Participant
    Post count: 35

    Found an example there from Brad that worked. For others:

    /** Force Full Width Layout On All Posts In A Category (Uses Category I.D*/
    add_filter( ‘genesis_pre_get_option_site_layout’, ‘full_width_layout_category_posts’ );
    /**
    * @author Brad Dalton
    * @link http://wpsites.net/web-design/change-layout-genesis/
    */
    function full_width_layout_category_posts( $opt ) {
    if ( in_category(’8′) && !is_archive() ) {
    $opt = ‘full-width-content’;
    return $opt;

    }
    }

    Cheers!

    #61066

    anitac
    Participant
    Post count: 7031

    Great! Glad you found something!


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Force Layout – Single Post – One Category’ is closed to new replies.