Conditional inside search result excerpt.
-
I’m trying – and failing – to add a conditional tag to the excerpts in my search results… so that if the excerpt is from a post it displays the post date and permalink, whereas if the excerpt is from a page it only displays the permalink and not the date.
Displaying the appropriate meta info is straightforward, but it’s the conditional code that I’m struggling with, having experimented with various permutations of if (is_single()), if (is_page()), and echo.
Help appreciated. Please/thanks/etc.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Conditional inside search result excerpt.’ is closed to new replies.