controlling the order of search results
-
To be able to display all the posts in a blog series, I created a tag unique to the series, added it to each post in the series, searched on it, and then used the URL of the results to link to the series. Unfortunately, the results are not displaying in the correct order, and I can’t figure out what order they’re in. It’s not alpha, publish date, or update date order. I have two questions: 1) How can I determine what’s creating the order of the search results? 2) Is there a way for me to control the order of the search results?
The blog I need help with is: (visible only to logged in users)
-
In case it helps, the blog I need help with is thespot.ljbinc.com. (The automated “blog I need help with” line in my post above isn’t right.)
-
Hi @ellearekay, search results are automatically ranked by relevance to the keywords used in the search, much like a search in Google or any other search engine. It can be quite tricky to get them to show in a particular order.
If you put all items in series in same category, though, you could simply link to that category. In fact, many themes will link to the category for you, automatically.
Or, you could even set up a widget to display all of the posts in a particular category, in a particular order.
-
Hi @ellearekay,
Instead of using search results for this, you could link to the tag archive page, then add
?order=ascto the end of the URL to list posts chronologically.The link below will list posts tagged with ‘anchorage blog series 2018’ in chronological order.
https://thespot.ljbinc.com/tag/anchorage-blog-series-2018/?order=asc
I hope this helps :)
https://en.support.wordpress.com/show-your-posts-in-chronological-order/
-
@garysixtyeight, that’s perfect. Thank you!
@supernovia, I can see shortcodes coming in handy. When I tried sticking [display-posts] in one of the posts, links to other posts (not only those in the series) showed up as a list at the end of that particular post. How do I avoid that? Did I do something wrong? -
-
@ellearekay It sounds like @garysixtyeight understood better what you’re after, so you likely won’t need to display posts in a category?
But if you did, there are several parameters listed in the support document so you can use that code according to you needs :)
For example:
[display-posts category="human-resources" posts_per_page="-1" include_date="true" order="ASC" orderby="title"]
- The topic ‘controlling the order of search results’ is closed to new replies.