• Resolved jbush82

    (@jbush82)


    I’m creating a child theme of Customizr and with it, a plugin that enables a persistant fasebook based login / logoff. I’d like to have the login / logoff content be displayed at the top of the Customizr theme and I think the right way to do this is create a child theme with a new “header” area, in addition to “right sidebar”, “left sidebar”, “footer widget area one”, “footer widget area two”, and three “footer widget area three”.

    My problem is that I’m not exactly sure how to do this given it is my first go at it. I found the content areas within the Customizr theme (class-header-header_main.php), but I’d rather not replicate that file and modify the one section I want. As such, I’m thinking it maybe easier to create a new widget area and somehow point it to the right location.

    Thoughts?

Viewing 7 replies - 16 through 22 (of 22 total)
  • B

    (@logicintl)

    DZ,

    Yes, true, that is, what is there.

    What happens next, how do I get stuff up in that space, how do I display stuff up in that space?

    Normally, in WP, we go to a widget, open it up, and put in, either text, or shortcode, or images, a URI or URL, … we put that in the widget box, click save, and viola ‘stuff’ is in the box, and on the website, “it’s magically delicious”!

    So, how does it work with this ‘Extra Widget Before Header’? How do I get me lucky charms into that dadgum header space?

    Let’s say I wanted to put a banner ad up in that space? Do you plop ‘code’ into the php file in between such and such, in a specific place in the code and pffft the banner ad shows up???

    I created widget area, ok, what is the next step? creating a widget?

    Thx, ??
    B

    Put a widget inside it ??

    B

    (@logicintl)

    DZ,

    Ok, ha, ha, that did not tell me where the pieces parts were hiding, smh!

    As I was tooling around in the ‘Customization Panel’ you know the Customiz’It button/panel/section of Customizr … yay, lo and behold a pull-down menu appeared, titled Widgets: Extra Widget Before Header … now that’s what I was expecting/hoping for, but I didn’t know where this was, I stumbled upon it, thankfully.

    I will experiment from here and see how it goes. Thanks for all your help! ??

    B

    Hi,

    I used the code above and created a new widget area, but when I put widgets in it they don’t show up on the front end. Any suggestinos of what I might be missing? I’ve used all the mentioned variants on location.

    Cheers,

    sdowns: take a look at the full snippet and make sure you’ve done everything you need to there. Also read customizing Customizr to make sure you’ve got the code in the right place.

    Hi guys,
    I need your help please.
    Many times I have tried to create a function.php file in my child team and it would never work, therefore I have given up and gone ahead editing the main function.php (I learned how to use filezilla and wordpress on my own, therefore I do not have a strong knowledge).

    I would like to have a currency widget (which I already have) on the header of my site, in order to be visible in every single pages:

    debruir.com

    I have followed the instructions above and I have pasted the following codes in my function.php:

    <?php
    // Add a widget.
    if (function_exists(‘register_sidebar’)) {
    register_sidebar(array(
    ‘name’ => ‘Extra Widget Before Header’,
    ‘id’ => ‘extra-widget’,
    ‘description’ => ‘Extra Widget Before Header’,
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h2>’,
    ‘after_title’ => ‘</h2>’
    ));
    }
    // Place the widget before the header
    add_filter (‘before_navbar’, ‘add_my_widget’);
    function add_my_widget() {
    if (function_exists(‘dynamic_sidebar’)) {
    dynamic_sidebar(‘Extra Widget Before Header’);
    }
    }

    By doing this operation I can see “Extra Widget Before Header” on my WordPress dashboard but, whenever I drag and drop the widget in the “Extra Widget Before Header” container, it wont work on the front end of my website.

    Am I doing anything wrong?
    I appreciate your attention guys and I hope I can finally solve this issue.

    Thanks.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Child Theme – Adding a "Header" Widget Area’ is closed to new replies.