Site logo

[Support request] Allow Sidebars with Sections

Home Forums Support [Support request] Allow Sidebars with Sections

Home Forums Support Allow Sidebars with Sections

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #563701
    Kevyn

    Hello,
    I would like to add a sidebar on a specific page while using sections.
    I see I have to add the PHP code: add_filter( ‘generate_sections_sidebars’,’__return_true’ );
    I installed the Code Snippets plugin and almost done installing a Child Theme.
    However, I do not understand where do I have to copy-paste this PHP code?
    Thank you!
    Kevyn

    #563756
    Leo
    Staff
    Customer Support

    Hi there,

    It would be in the child theme’s function.php file.

    #1250752
    Yurik

    I would like to add a sidebar on a specific page while using sections PHP code: add_filter( ‘generate_sections_sidebars’,’__return_true’ );

    if it not a Child theme, where do I have to copy-paste this PHP code? Please help
    Thank you!
    Yurik

    #1250969
    David
    Staff
    Customer Support

    Hi there,

    if you’re not using a Child Theme you can use the Code Snippets plugin:

    https://en-gb.wordpress.org/plugins/code-snippets/

    #1251002
    Yurik

    Hi David, thanks for quick reply!

    I have tried with Code Snippets, by adding new and pasting the php code as it is, but it not working on my site. Maybe I’ve missed something and need to write any function a part?
    Please can you show me any example, or create and clone one so I could try?

    Many thanks!

    Snippets capture

    #1251118
    David
    Staff
    Customer Support

    I replied to your Topic here

    #1251175
    Yurik

    Hi David,

    thanks agin for reply! Unfortunately this is still not working for me.
    I have sidebars ON in layouts and snippets is enabled on whole site, but in the url im tryin to enable the section the sidebar not appears.

    Please check this out here, where I’m have page with sections enabled: https://spainru.com/biznes-v-ispanii/

    The Sidebar Layout is active and setup to show “Content/Sidebar” (basically I have this conf. by default, same for all sites & posts. Main page and all other have sidebar visible.

    Examples

    Layout conf – https://imgur.com/a/ev4WkDu and https://imgur.com/a/VDYRs2x

    Snippet conf – https://imgur.com/a/ZyjPFxd

    I’m really lost and not sure where is the fix. What else I could do to make it work?

    Many thanks!

    #1252324
    Tom
    Lead Developer
    Lead Developer

    You may need the code to fire later. Try this:

    add_action( 'wp', function() {
        add_filter( 'generate_sections_sidebars', '__return_true' );
    } );
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.