Looking to change style of Search pages

Hello support team,

I am looking to change the search page around but I am having problems with the coding of it. I am not sure how to integrate it with the already existing search.php I have tried this line of code and i seems to break part of my site.

Any help implementing this code would be appreciated.

sorry for the sloppy code, but I could not seem to get everything in the container.

<?php _e( 'Search', '__x__' ); ?>

get_header(); ?>




<?php get_search_form(); ?>
    <?php if ( have_posts() ) : ?>

        <header class="page-header">
            <span class="search-page-title"><?php printf( esc_html__( 'Search Results for: %s', stackstar ), '<span>' . get_search_query() . '</span>' ); ?></span>
        </header><!-- .page-header -->

        <?php /* Start the Loop */ ?>
        <?php while ( have_posts() ) : the_post(); ?>
        <span class="search-post-title"><?php the_title(); ?></span>
        <span class="search-post-excerpt"><?php the_excerpt(); ?></span>
        <span class="search-post-link"><a href="<?php the_permalink(); ?>"><?php the_permalink(); ?></a></span>

        <?php endwhile; ?>

        <?php //the_posts_navigation(); ?>

    <?php else : ?>

        <?php //get_template_part( 'template-parts/content', 'none' ); ?>

    <?php endif; ?>

    </main><!-- #main -->
</section><!-- #primary -->
<?php //get_sidebar(); ?> <?php get_footer(); ?>Preformatted text

Hi,

Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your email. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (r perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.

Thanks

Hey Paul,

Thank you for the reply!

Forget about the previous code that I had sent.

This is what I would like to do with the search page

I am looking to change the style of my search page.

Unfortunately, custom development would cost too much for this job and I feel that it would not require that much coding to get a simple search page.

I have set my search results to only look for posts.

So post pages are the only thing that is displayed on the search results

My current search page looks like this:

The search results are very big on the page and would like to have them be in rows so the user can navigate through the search results a bit easier.

Something that looks sort of like this

Also, I would like to remove the sidebar.

I am not interested in hiring custom development as they will over charge me for such a simple task.

Is this simple task possible?

Thanks for your help!

Hi there,

I am sure you will understand that this is a customization request which is outside of our support scope, we will do our best to help you show how you do that in some extent but we will not be able to implement the functionality for you.

Regarding the limiting the search results to only posts it is indeed not a thing that we can be of a help, it is not related to the theme and is more of a core search functionality of the WordPress. The only thing we can give to help is a Google Search which will help you investigate more on the matter.

But when it comes to the layout functionality you can add the CSS code below to X > Launch > Options > CSS:

.search-results .x-sidebar {
	display:  none;
}

@media (min-width: 767px) {
	.search-results .x-main article {
		width: calc(33% - 30px);
		float:  left;
		margin: 0 15px;
	}
}

The code above can be a starting point to make a 3 column view for the search result page.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.