Site logo

Archived topic

content-search

5 replies · Started by Dan on September 29, 2020

Viewing posts 1–6 of 6

Hi
I understand that in order to customize the search results page I will copy over content.php to child theme and rename it to content-search.php and do my modifications.
But, where can I access the top part of the page with the # of results, the search form and the bottom pagination. Where is it all constructed?

<div class="entry-content" itemprop="text">
<div class="searchwp-search-form searchwp-supplemental-search-form">
<form role="search" method="get" id="searchform" class="searchform" action="/~sloveniangenealo/voice-of-youth-search/">
<div>
<label class="screen-reader-text" for="swpquery">Search for:</label>															<input type="text" placeholder="Search" value="voice" name="swpquery" id="swpquery">
<input type="hidden" name="engine" value="voice_of_youth_search">
										<input type="submit" id="searchsubmit" value="Find Results"></div>
</form>
	</div> 
<div class="search-results-wrapper">
  Total Results: 25

Bottom of page:

<nav id="nav-below" class="paging-navigation">
	<span class="screen-reader-text">Post navigation</span>
	<div class="nav-previous">
	<span class="prev" title="Previous"><a href="http://r4.temporary-access.com/~sloveniangenealo/page/2/?s=tree">Older posts</a></span>
					</div>
	<div class="nav-links"><span aria-current="page" class="page-numbers current">1</span>
<a class="page-numbers" href="http://r4.temporary-access.com/~sloveniangenealo/page/2/?s=tree">2</a>
<span class="page-numbers dots">…</span>
<a class="page-numbers" href="http://r4.temporary-access.com/~sloveniangenealo/page/8/?s=tree">8</a>
<a class="next page-numbers" href="http://r4.temporary-access.com/~sloveniangenealo/page/2/?s=tree">Next →</a></div>		</nav>

Thanks,
Dan

Hi there,

The search results template in GeneratePress uses the standard content.php file to display the results.

The markup you referenced seems to be coming from SearchWP.

content-search.php is the correct filename if you want to use a custom loop for the search results in your search template.

Hi Tom,
you are correct, it's the SearchWP shortcode creating that markup.
Would you have any clue how to enable pagination while using their shortcode instead of the 'next', 'prev' links?

Thanks
Dan

Not too sure what you mean - do they offer their own pagination?

Hi Tom, thanks for your reply.
They have just introduced pagination, so I am marking this as resolved.

Thanks
Dan

Awesome :)

This archived topic is closed to new replies.