How to change posts layout for one category?

  • Author
    Posts
  • #116855

    I want to change posts layout to three columns for one of the category while for the other categories it is specified two columns post layout.
    I create new category-catalog.php for this category, but i don’t understand how to change the posts layout.
    Please help!

    #117383
    Zed
    Cryout Creations mastermind

    Hi,

    The theme controls the posts layout through its configuration options – you’d need to override the configured value for specific sections by filtering the theme’s options. Something along the lines of:

    function child_custom_posts_layouts( $options = array(), $option_name = '' ){
        /* possible posts layout values are: 1, 2 or 3 */
        if ( is_category( 123 ) ) $options['fluida_magazinelayout'] = 3;
        return $options;
    }
    add_filter( 'option_fluida_settings', 'child_custom_posts_layouts', 11, 2 );

    Note that this code is not tested.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #117493

    Thanks!

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

The topic ‘How to change posts layout for one category?’ is closed to new replies.