Call single.php if only one post in search.php
-
I have muddled together a site, from the Bare Minimum Theme.
It is a CMS rather than a blog, but because of categories and other reasons I have forgotten, I am using posts like pages.
After a searchform.php or tag select, I go to search.php to list my results.
If I have only one post, I want to skip out of search.php and run single.php, but I do not seem to be able to work out how to do this.
My pseudo code in search.php would be
if NoOfPosts == 1 then call single.php(ThisPost)
It may be that I do not have to pass ThisPost as WordPress may already know it.I am very much a novice at all this, but if any one can advise, I would be most grateful.
Richard
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Call single.php if only one post in search.php’ is closed to new replies.