• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Simple SIdebars for search results page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Simple SIdebars for search results page

This topic is: not resolved

Tagged: sidebars, streamline

  • This topic has 9 replies, 2 voices, and was last updated 12 years, 7 months ago by Brad Dalton.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • June 15, 2013 at 9:42 am #46096
    ecoofficegals
    Member

    I'm using the simple sidebars plugin for Genesis in a Streamline theme and would like a sidebar we created ID blog-sidebar to show on search results pages like http://www.indiebusinessnetwork.com/?s=cvxkjvlj instead of the primary sidebar, is this possible and how? Thanks in advance.

    Jen


    Jen Smith
    Owner, Eco-Office Gals

    June 15, 2013 at 10:58 am #46108
    Brad Dalton
    Participant

    You mean on 404 page not found error results?

    Otherwise there's a conditional tag for search pages which you could use with a custom sidebar template. I don't think you can use it with the simple sidebars plugin.


    Tutorials for StudioPress Themes.

    June 15, 2013 at 11:06 am #46109
    ecoofficegals
    Member

    Hey Brad,

    No I mean if you go to http://www.indiebusinessnetwork.com/blog/ and put a nonsense search in the field we have a search result page set up like http://www.indiebusinessnetwork.com/?s=sfkldjk to allow people to search again, that sidebar on that page is the primary sidebar my client wants the blog page sidebar to show up.

    The purpose is so when results do show up, but not the results they are looking for like say http://www.indiebusinessnetwork.com/?s=ibn they don't have the search fiels in the content of the page so she wants the blogsidebar to be there so that the search field is there. She doesn't want the search field on the primary sidebar.


    Jen Smith
    Owner, Eco-Office Gals

    June 15, 2013 at 3:37 pm #46164
    Brad Dalton
    Participant

    So you have a custom template named search-no-results?


    Tutorials for StudioPress Themes.

    June 15, 2013 at 3:50 pm #46168
    ecoofficegals
    Member

    We used most of this code http://ahjira.com/create-a-custom-genesis-search-results-page-for-no-posts-found/ in the theme functions file.

    This is what we have in there:

    //* Custom search results page
    remove_action( 'genesis_loop_else', 'genesis_do_noposts' );
    add_action( 'genesis_loop_else', 'my_do_noposts' );
    function my_do_noposts() {

    $term = $_GET['s']; // store the search term in a variable

    echo '<div class="entry-content">';
    echo '<div class="post">';

    printf( '<p>%s</p>', apply_filters( 'genesis_noposts_text', __( '<p>Sorry, but nothing matched your search criteria for: <strong>' . $term . '</strong>.</p><p>Please try again with some different keywords below.</p>', 'genesis' ) ) );

    printf( '<div class="genesis-search">' . get_search_form() . '</div>' );

    echo '</div><!-- close entry-content -->';
    echo '</div><!-- close post -->';
    }


    Jen Smith
    Owner, Eco-Office Gals

    June 15, 2013 at 4:16 pm #46173
    Brad Dalton
    Participant

    I can't test that code because it hasn't been embedded properly.

    Is this the exact code you are using:

    It seems to include another file named search-helper.php which is not a Genesis file.


    Tutorials for StudioPress Themes.

    June 15, 2013 at 4:33 pm #46181
    ecoofficegals
    Member

    I tried to put it in the comments Github but I guess I don't know what I'm doing it messed up.

    It's correct  minus a few lines, the H1 class, the include search helper (yes we didn't use this in it) and the actual content wording, added is the

    add_action( 'genesis_loop_else', 'my_do_noposts' );


    Jen Smith
    Owner, Eco-Office Gals

    June 15, 2013 at 4:36 pm #46184
    ecoofficegals
    Member

    Maybe this is right

    <script src="https://gist.github.com/ecoofficegals/15422385addbc9bd1e03.js"></script>

    Otherwise here is the link https://gist.github.com/ecoofficegals/15422385addbc9bd1e03 again that's if I did it right


    Jen Smith
    Owner, Eco-Office Gals

    June 15, 2013 at 5:01 pm #46193
    ecoofficegals
    Member

    You can disregard this I talked the client into putting the search back into the primary. I don't think you should make your readers search for a way to search your site 🙂 Thanks!


    Jen Smith
    Owner, Eco-Office Gals

    June 15, 2013 at 5:08 pm #46194
    Brad Dalton
    Participant

    Ok.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble