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 1 year, 3 months ago.

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

    babrees
    Participant
    Post count: 61

    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’ ),
    ) );

     

    #34268

    Ozzy
    Participant
    Post count: 211

    try adding this to your functions file as well:
    [php]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 –>’;
    }[/php]


    #34456

    babrees
    Participant
    Post count: 61

    Perfect!  Thanks Ozzy!

    #39719

    derekpierce
    Participant
    Post count: 3

    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 1 year, 3 months ago by  derekpierce.
    • This reply was modified 1 year, 3 months ago by  derekpierce.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.