Home › Forums › Pro Themes › Photomania Pro › Search Results
- This topic has 1 reply, 2 voices, and was last updated 7 years, 8 months ago by
wensolutions.
-
AuthorPosts
-
December 22, 2016 at 9:21 am #26449
jjthetutor
ParticipantIs there an easy way to have the search results display the same way the category selection results display? I would like the user to have the same experience with direct search as they do with category selection. This is the perfect theme but the search results and not being able to click the image to view the post are essential, for me, at least. I hope you guys can squeeze that in sometime in the near future. It would make my site incredible!
Thanks again for the help!
December 22, 2016 at 11:10 pm #26490wensolutions
KeymasterHello @jjthetutor,
The default theme design in the Photomania pro theme has defined the current layout of the theme.
Luckily, we can help you with some code to swap the search layout to give it the look of the archive page with child theme approach.
If you need any reference for child themes see the link here : https://codex.wordpress.org/Child_Themes.
You can also automate the child theme creation with the help of Child theme generator plugin.After successful creation and activation of child theme, please create a new file “search.php” in your child theme directory and paste in the following code in the search.php file :
<?php /** * The template for displaying search results pages. * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result * * @package Photomania */ get_header(); ?> <section id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'photomania-pro' ), '<span>' . get_search_query() . '</span>' ); ?></h1> </header><!-- .page-header --> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php /** * Run the loop for the search to output the results. * If you want to overload this in a child theme then include a file * called content-search.php and that will be used instead. */ get_template_part( 'template-parts/content', get_post_format() ); ?> <?php endwhile; ?> <?php /** * Hook - photomania_action_posts_navigation. * * @hooked: photomania_custom_posts_navigation - 10 */ do_action( 'photomania_action_posts_navigation' ); ?> <?php else : ?> <?php get_template_part( 'template-parts/content', 'none' ); ?> <?php endif; ?> </main><!-- #main --> </section><!-- #primary --> <?php /** * Hook - photomania_action_sidebar. * * @hooked: photomania_add_sidebar - 10 */ do_action( 'photomania_action_sidebar' ); ?> <?php get_footer(); ?>
This will load the search page template similar to that of archive, with images.
You can control the thumbnails properties via same customizer setting that controls the parchive layout.
Hope this Helps,
Best Regards !!
-
AuthorPosts
- You must be logged in to reply to this topic.