• 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

Custom Layout in Search Result 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 › Custom Layout in Search Result Page

This topic is: resolved

Tagged: Bootstrap, Search Page

  • This topic has 4 replies, 2 voices, and was last updated 11 years ago by artmaug.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 13, 2015 at 6:07 pm #152102
    artmaug
    Member

    Hello, I would like some help if possible in the following question:

    I use in my Genesis theme a bootstrap grid, and would like to display the search results using this grid.

    I put the following code in the plugin Simple Hooks genesis_entry_content Hook:

    <?php
    if(is_search()) { ?>
    
    <div class="container-fluid">
    
    <div class="row">
    
    <div class="col-md-3 col-sm-6 col-xs-12">
    <div class="gr-infos-container-cliente">
    <div class="gr-promo-do-cliente"><?php the_field('tipo_de_promo');?></div>
    <div class="gr-img-cliente"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><img src="<?php echo get_field('foto_cliente_miniatura');?>" alt="" class="img-responsive center-block"></a></div>
    <div class="gr-nome-cliente"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title();?></a></div>
    <div class="gr-tagline-cliente"><?php the_field('tagline_do_anunciante');?></div>
    <div class="gr-bairro-do-cliente"><i class="cliente fa fa-map-marker"></i><?php the_field('bairro_do_cliente');?></div>
    </div>
    </div>
    
    </div> <!-- Row -->
    
    </div> <!-- Container -->
    
    <?php }
    ?>

    But in the search result, the content is aligned one on top of another and not in the selected grid.

    Any tips you can give me?

    I am very grateful for any help!

    May 13, 2015 at 6:48 pm #152110
    Brad Dalton
    Participant

    You will need to add all the CSS that works with the classes the PHP code you posted generates

    And

    You will also need to add the

    genesis():

    function at the very end of the file.

    You can name the file search.php or load its using the is_search() conditional tag.


    Tutorials for StudioPress Themes.

    May 13, 2015 at 7:10 pm #152112
    artmaug
    Member

    Hello braddalton, thanks for the quick response, but i try here and does work.

    I created a search.php with the following code:

    <?php
    /**
     * Search Results Template File
     */ 
    get_header(); ?>
    	<header>
    		<h1>Search Results: &quot;<?php echo get_search_query(); ?>&quot;</h1>
    		<br>
    	</header>
    
    <?php if ( have_posts() ) :  // results found?>
    	<?php while ( have_posts() ) : the_post(); ?>
    
    <div class="container-fluid">
    
    <div class="row">
    
    <div class="col-md-3 col-sm-6 col-xs-12">
    <div class="gr-infos-container-cliente">
    <div class="gr-promo-do-cliente"><?php the_field('tipo_de_promo');?></div>
    <div class="gr-img-cliente"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><img src="<?php echo get_field('foto_cliente_miniatura');?>" alt="" class="img-responsive center-block"></a></div>
    <div class="gr-nome-cliente"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title();?></a></div>
    <div class="gr-tagline-cliente"><?php the_field('tagline_do_anunciante');?></div>
    <div class="gr-bairro-do-cliente"><i class="cliente fa fa-map-marker"></i><?php the_field('bairro_do_cliente');?></div>
    </div>
    </div>
    
    </div> <!-- Row -->
    
    </div> <!-- Container -->
    
    <?php endwhile; ?>
    
    <?php else :  // no results?>
    	<article>
    		<h1>No Results Found.</h1>
    	</article>
    <?php endif; ?>
    <?php get_footer(); ?>
    
    genesis();
    

    Unfortunately the content remains on top of the other.

    May 13, 2015 at 7:20 pm #152117
    Brad Dalton
    Participant

    Where is your CSS?

    Link to your site please.


    Tutorials for StudioPress Themes.

    May 13, 2015 at 7:36 pm #152119
    artmaug
    Member

    Hello, the link is:

    SITE

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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