• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

full-width-content based on category

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: category based layout

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 6 months ago by kriskl.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 28, 2013 at 9:07 am #59224
    kriskl
    Participant

    Hello,

    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;

    }

    }

    http://opentuition.com/aat/suppliers_invoices_and_credit_notes_questions/
    August 28, 2013 at 5:14 pm #59345
    Brad Dalton
    Participant

    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


    Tutorials for StudioPress Themes.

    September 5, 2013 at 1:32 am #60788
    kriskl
    Participant

    Just to resolve this topic.

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

    once it was deactivated, the code started working

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble