This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Adding a custom widget area to themeblvd_footer_above hook

  • Creator
    Topic
  • #4137
    propagandalabs
    Participant

    Hi Jason,
    We’ve been through the documentation/forums and see that “themeblvd_footer_above()” it’s not a default hook. We would like to know how to activate it use it as an assignable custom widget area.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #4138
    Jason Bobich
    Keymaster

    So, in general, it’s a good idea to start familiarizing yourself with the hook system itself. So, your first question is basically “How do I put something in the themeblvd_footer_above” action hook?

    http://dev.themeblvd.com/tutorial/actions/

    http://dev.themeblvd.com/tutorial/primary-framework-action-hooks/

    And the answer would be to create your custom function that displays your content, and then you use add_action to add it to the correct action.

    The next question is essentially, “How do I create and display a widget area?” If you’re just trying to do this in WordPress in general, it’s very easy. Register it from your Child theme’s functions.php and display it within whatever function you’re hooking to your action hook.

    Now if you want to get fancy and use some of the framework’s unique things, you can register what the theme calls a “sidebar location.” Basically this means that now if you wanted you could use the Widget Area manager (Appearance > Widget Areas) to then create custom widget areas that could then be swapped into that location depending on different pages and what not.

    The full breakdown on that is here:

    http://dev.themeblvd.com/tutorial/widget-areas-for-the-end-user/#widget-area-locations

    http://dev.themeblvd.com/tutorial/default-widget-area-locations/

    How to add your custom location and display it: http://dev.themeblvd.com/tutorial/addremove-widget-area-location/

    #4139
    propagandalabs
    Participant

    Thank you…btw we think you are a genius. The latter part of your answer probably covers it, but just to clarify, we need a new custom widget area location, available via the TB CWA admin screen’s dropdown (example name “shiz above footer”). Then any user would simply display content via widgets in that area. Thus far we came up with this, which is prob good for a laugh:

    function themeblvd_footer_above() {
    themeblvd_display_sidebar( ‘themeblvd_footer_above’ );
    }
    add_action( ‘themeblvd_footer_above’, ‘shiz_above_footer’ );

    #4143
    Jason Bobich
    Keymaster

    Use this is a starting point 😉

    /** 
     * Add sidebar location (will also register a default sidebar automatically)
     */
    themeblvd_add_sidebar_location( 'my_widget_location', 'My Widget Location', 'collapsible' );
    
    /**
     * Display widget area with id "my_widget_location"
     */
    function my_footer_above() {
        echo '<div class="my-widget-area">';
        themeblvd_display_sidebar( 'my_widget_location' );
        echo '</div>';
    }
    add_action( 'themeblvd_footer_above', 'my_footer_above' );

    … Throw that in your functions.php of your Child theme anywhere after the framework included in there, and then go to Appearance > Widgets in your WordPress admin and see what has happened.

    #4149
    propagandalabs
    Participant

    Again, thank you. Trying hard not to be “THAT GUY” so please know:

    A) I’ve gone through “addremove-widget-area-location” and have tried adding the documentation’s example code (as-is and customized) AND separately the example code in your response to the (child) functions.php

    B) On other sites I’ve added things to (child) functions.php successfully in the past and

    BUT, regardless of code placement in functions.php, adding these particular code examples (customized or not) WHITESCREENS the admin as if the syntax is wrong, but it seems correct. Any thoughts? http://tinypic.com/r/znllc3/6

    Also, regarding the actual hook location, based on the documentation/other action hooks present, are we correct in placing the following code in footer.php (where we want in in the #bottom div)?

    &lt;?php themeblvd_footer_above(); ?&gt;
    #4152
    propagandalabs
    Participant

    Jason, Please ignore / delete this and the previous comment; the child functions.php was from 3.0 and was never updated. Everything works fine and makes perfect sense. Thanks and if you’re ever in Denver, we’ll buy the beers ;}

    #4230
    Jason Bobich
    Keymaster

    I just wanted to point out one thing here that I can as being pretty confusing. —

    Also, regarding the actual hook location, based on the documentation/other action hooks present, are we correct in placing the following code in footer.php (where we want in in the #bottom div)?

    In the current version of the theme, it is a bug that themeblvd_footer_above() is not called by default in footer.php. The idea with these hooks is that you would never have to edit footer.php. This has is somethign that’s been fixed for the next update.

    However, with the theme the way it is now, you can actually achieve the identical result by hooking to “themeblvd_footer_content” with a priority number less than 10 like this:

    add_action( 'themeblvd_footer_content', 'my_footer_above', 9 );
    #5787
    propagandalabs
    Participant

    Jason,
    Thanks for the follow up. I had success with adding

    <?php themeblvd_footer_above(); ?>

    to the #bottom div (a deviation I believe) in footer.php, then using the following:

    themeblvd_add_sidebar_location( 'themeblvd_footer_above', 'Shiz Above Footer', 'collapsible' );
    
    function display_my_new_location() {
        echo '<div class="my-new-widget-area">';
        themeblvd_display_sidebar( 'themeblvd_footer_above' );
        echo '</div>';
    }
    add_action( 'themeblvd_footer_above', 'display_my_new_location' );

    SEE SCREENSHOT, which isn’t fully styled but you’ll get the point. http://tinypic.com/r/2ivnr5h/6

Viewing 7 replies - 1 through 7 (of 7 total)
  • The forum ‘Barely Corporate Responsive WordPress Theme’ is closed to new topics and replies.