Skip to main content

All Questions

Tagged with
0 votes
1 answer
35 views

Different date time in results of search

In my search.php file i have a loop which succesfuly gives list of search query. global $wp_query; $total_results = $wp_query->posts; if ( $total_results ) : foreach ( $...
X9DESIGN's user avatar
  • 169
1 vote
1 answer
54 views

Wordpress search results grouped by post type

I've been struggling to make it work. This code works and returns post_type title and post titles inside it. I found it here But i need to have some sort of formatting and excerpt. Currently I cannot ...
m2itz's user avatar
  • 11
0 votes
0 answers
18 views

How do I set the Stewart Search Template to return only published posts in the result

I recently took a WP.com online webinar and the moderator referred me here to ask my question. I am trying to redesign my site using FSE. I am using the "Stewart" theme. I have added a ...
Kevin's user avatar
  • 1
0 votes
1 answer
27 views

Trying to get all links in my posts

I am trying to return all the links inside my posts'/pages' content, but I can't figure out how to get my regex/loop to work right. Here is what I have at the moment, that just returns a bunch of ...
Michael's user avatar
  • 281
1 vote
1 answer
125 views

How to get an array of years from all of the search results, and use it to filter by year the paginated loop?

I hope this is not too dumb: even though I'm learning at an acceptable rate, my WP knowledge still has some important gaps. What do I have: My search.php template gets its results from the normal ...
Marks's user avatar
  • 31
1 vote
0 answers
23 views

Separeting product from post in search result

I am trying to separete products from posts in the search result. I can see the loop there search in both. if( have_posts() ) { while( have_posts() ) { ...
Leandro Andrade's user avatar
0 votes
1 answer
454 views

Pagination Error : Duplicate argument being outputted

I've been writing a custom search.php loop for some time now and I'm running into a weird problem. My php argument is outputting some unexpected results by repeating the template file. Currently I ...
Lewis's user avatar
  • 368
0 votes
2 answers
356 views

Include future posts in tags and in search

I am using something like this to query and display future or scheduled posts on my homepage: <?php query_posts('post_status=future&posts_per_page=10&order=ASC'); while ( have_posts() ) : ...
ben.kaminski's user avatar
-1 votes
1 answer
35 views

Help with showing text when something is entered in my search bar

I'm having troubles replacing text when there is something entered in the search form. As you can see in the image below i want to replace 'mijn gemeente' with the get_search_query text if i'm ...
Dennis's user avatar
  • 21
0 votes
2 answers
944 views

post_type incorrect for custom post type

I am trying to display a different template depending on the post type. I have registered two custom post types called resource and contact. When I try to get the post type in search.php (using ...
Ged's user avatar
  • 1
1 vote
3 answers
2k views

Group search results by post type, but hide post types with no results

I was looking for a clean way to group my search results by posttype. I currently have 3 post types: Page, Post and Glossary. After a long search this answer in this thread got me what I needed. The ...
Justin's user avatar
  • 45
1 vote
1 answer
43 views

What to and how to proceed with CPT to make DB small and efficient?

This is the info we have Bus Name Table id , bus_name 1 BUS1 2 BUS2 3 BUS3 Stop Name Table id, stop_name 1 STOP1 2 STOP2 3 STOP3 4 STOP4 5 STOP5 Route ...
Vasan's user avatar
  • 11
0 votes
1 answer
215 views

Work arounds for conditional checks inside the loop in search.php?

Main Issue: I can't use Wordpress conditional checks (is_page(), is_front_page() and is_page_template()) inside the main loop of my search.php file. I know the Codex states that is_page() and other ...
Jonathan Ryan Patterson's user avatar
4 votes
1 answer
107 views

How do I get the total number of categories in a list of search results?

I want to display the total count of categories in a set of search results. For example, "10 posts found in 3 categories." (Assuming that each post has only 1 category.) Right now, my solution is to ...
Adam Pearlman's user avatar
0 votes
1 answer
161 views

what's the syntax for if the image exists get the image?

I want this to display images instead of posts. What would be the syntax for replacing posts with the images on my site? My code currently says while have post then show the post. I want it to be ...
Taylo.K's user avatar
  • 33

15 30 50 per page