full-width-content based on category

Community Forums Forums General Discussion full-width-content based on category

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  kriskl 2 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #59224



    I have tried this code (copied/modified) from previous post here on the forums, and it works on my test local site, but for some unknown reason, it fails to work on the live site :(

    for example: http://opentuition.com/aat/suppliers_invoices_and_credit_notes_questions/

    what I want is to remove the sidebar from all posts which have ‘aat’ as the category

    add_filter( ‘genesis_pre_get_option_site_layout’, ‘change_layout_posts_in_category’);
    * @author Brad Dalton – WP Sites
    * @example http://wp.me/p1lTu0-a1b
    function change_layout_posts_in_category( $opt ) {
    if (in_category(‘AAT’) ) {
    $opt = ‘full-width-content';
    return $opt;





    Try using the category i.d rather than the category name or slug.

    Note: If someone copies the above code into their functions.php file using the theme editor it will break their site because the apostrophes will turn around. Please use Github Gists or Pastebin to paste code in a webpage. Thanks



    Just to resolve this topic.

    the problem was bbPress Genesis Extend plugin was causing the problem.

    once it was deactivated, the code started working

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

You must be logged in to reply to this topic.