New Landing How can we help? Themeforest Theme Support Neighborhood How to safely add/register more sidebars

Viewing 8 posts - 1 through 8 (of 8 total)
  • #95238
    Nickylew
    Member
    Post count: 35

    Hi there,

    I am in need of even more sidebars. I know there are already a lot of sidebars in there available but the particular site we are setting up could do with a few more for specific pages/products.

    I have found where the sidebars are being registered in the functions.php of the theme, but without wanting to edit this how can I safely register more custom sidebars and give them a name etc.

    Would be very grateful for help on this one.

    Many Thanks

    #95317
    Kyle – SUPPORT
    Moderator
    Post count: 35880
    #95368
    Nickylew
    Member
    Post count: 35

    Okay,

    So if I copy and paste the code from the functions.php file into my child theme functions.php file will that safely create the new sidebars? Being as all this should already be styled etc I should only need to register them right?

    Cheers

    #95370
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Yes that should work, however I have not tested before so let me know if you have any issues

    – Kyle

    #95372
    Nickylew
    Member
    Post count: 35

    Well, copying and pasting the entire registers sidebar code and adding in more sidebars does not work. caused the site to crash somewhat.

    Any ideas? Or what code I need to drop in there just to add the new sidebars but not fully copy and paste the whole register sidebars section?

    #95376
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Instead of adding the whole code, just add a new sidebar in your child theme, so basically just add:

    register_sidebar( array(
        'name'         => __( 'Right Hand Sidebar' ),
        'id'           => 'sidebar-1',
        'description'  => __( 'Widgets in this area will be shown on the right-hand side.' ),
        'before_title' => '<h1>',
        'after_title'  => '</h1>',
    ) );

    – Kyle

    #95385
    Nickylew
    Member
    Post count: 35

    Excellent, that seems to have done the trick. My sidebars have slightly mixed themselves up (content that was in sidebar 1 is now in sidebar 11 – as I added three new sidebars) but thats easily sorted.

    Many Thanks

    #95388
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    No problem

    – Kyle

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

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register