perfectlover
Member
Posted 1 year ago #
I want to use conditional tags to display content based on different url but do not know how to implement it, for example if page is
http://examplesite/?Search=wordpress
show
XYZ
if
http://examplesite/?Search=plugin
show
ABC
and so on
Thanks in advance
Steve
Alok Tiwari
Member
Posted 1 year ago #
Read this http://codex.wordpress.org/Creating_a_Search_Page
Try with this code
<?php
if( trim( wp_specialchars($s,1) ) == 'wordpress' ) :?>
[ Show XYZ ]
<?php elseif( trim( wp_specialchars($s,1) ) == 'plugin' ) :?>
[ Show ABC ]
endif;
?>
perfectlover
Member
Posted 1 year ago #
Thanks,
Actually search I used just an example, is it possible to define url? I am using a premium theme where categories are in custom post type and i want to use different content on different category.