conditional rules for search page
-
Relative PHP noob here, trying to figure out how to add conditional code to display search results differently, depending on post category. Would really appreciate any help anyone can provide.
I’d like a way to have my search page display search results from the post category ‘event’ as follows:
<div class="searchresult"> <a href="https://myurl#<?php the_title(); ?>"><?php the_title(); ?></a> </div>
Meanwhile I want it to display search results from the post category ‘speaker’ as follows:
<div class="searchresult"> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </div>
Any ideas on how to write the conditional markup for this?
- The topic ‘conditional rules for search page’ is closed to new replies.