displaying new widget

Community Forums Forums General Discussion displaying new widget

This topic is: not resolved

This topic contains 3 replies, has 3 voices, and was last updated by  derekpierce 2 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #34235


    I have registered a new widget but am having a problem getting it to display at the front end.

    I want it to show before the content (or after the content_sidebar_wrap!).  I have added following to my functions.php to register it and that’s ok.  I have tried various add functions but cannot get it right!

    genesis_register_sidebar( array(
    ‘id’            => ‘topsearch’,
    ‘name’            => __( ‘Top Search’, ‘agency’ ),
    ‘description’    => __( ‘This is the Top Search section of the homepage.’, ‘agency’ ),
    ) );




    try adding this to your functions file as well:

    add_action( ‘genesis_before_content’, ‘top_search_widget’ );
    function top_search_widget() {
    echo ‘<div class="top-search">';
    dynamic_sidebar( ‘top-search’ );
    echo ‘</div><!– end top search widget –>';



    Perfect!  Thanks Ozzy!



    The theme is Agency and I’m looking at the same thing – got all the sidebars registered, but what if you wanted it to go before the welcome note on the home page?

    • This reply was modified 2 years ago by  derekpierce.
    • This reply was modified 2 years ago by  derekpierce.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.