Skip to:
Content
Pages
Categories
Search
Top
Bottom

Themeing : functions.php and registering additional sidebars.


  • jamesjones
    Participant

    @jamesjones

    Hi

    Where should i regsiter additional sidebars? In my child functions.php or in my parent function.php

    I have tried both. And get better results by registering in the parent. Just wondering what is “correct” or best practice when generating themes.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

  • Brajesh Singh
    Participant

    @sbrajesh

    I will go with Child themes functions.php for registering specific sidebar for a child theme.

    It will be more flexible and specific to the child theme.

    What issues you encounter while using child theme’s functions.php.


    jamesjones
    Participant

    @jamesjones

    Hi Brajesh,

    When i regsiter sidebars in the child theme, it tends to break the layout of the site – when i add the additional side bars to the parent the display is correct. It might just be that i haven’t fully completed the theme.

    I will play around some more and revert once i have tested it some more. Thanks for the reply.


    jamesjones
    Participant

    @jamesjones

    After further testing – i think my issue was some of the sidebars where coming from the parent and the additional ones from the child.

    I duplicated the sideabars from the parent and everything appears to be displaying as it should.

    Never really understood the child/parent relationship until last night – and its an amazing way to build themes.


    Brajesh Singh
    Participant

    @sbrajesh

    That’s right. so you know the reason now and the best thing is you know how much useful this child theme could be.

    You can unregister the sidebars from parent which you don’t want to use in the child, but I don’t remember exactly will it work in current wp or not, earlier version was having some issue when you try to unregister a parent theme widget area from child theme.


    jamesjones
    Participant

    @jamesjones

    Hi Brajesh.

    Interesting as i did not “unregister” the sidebars so to speak as they are still being used. – i just duplicated them in the Child and add the addtional ones in the child function.php as well.

    I think as the theme i am building develops – i will unregister them as needed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Themeing : functions.php and registering additional sidebars.’ is closed to new replies.
Skip to toolbar