• What is the code to add a custom sidebar to a layout-file?

    I get the ID of the custom sidebar, but I do not know of any shortcode, which I could add to my layout-file?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Amit Singh

    (@apprimit)

    Hello,

    In the layout file, you need to add below code to display the sidebar.

    <?php dynamic_sidebar( 'custom-sidebar-id' ); ?>

    Thread Starter Avantart

    (@avantart)

    thank you, I will try that!

    What a pity that all these necessary infos are not in the documented… you have to ask for every piece of code…

    I am happy!

    Connie

    Plugin Author Amit Singh

    (@apprimit)

    You can also check wordpress codex for the sidebar. Let me know if that doesn’t work.

    Thank you Amit for the code to display the custom sidebar within a template layout.

    Very handy.

    Plugin Author Amit Singh

    (@apprimit)

    You’re welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add custom sidebar to childtheme / partials / layout-file?’ is closed to new replies.