Title: Conditional search-forms and PHP
Last modified: May 26, 2019

---

# Conditional search-forms and PHP

 *  [sputtering](https://wordpress.org/support/users/sputtering/)
 * (@sputtering)
 * [7 years ago](https://wordpress.org/support/topic/conditional-search-forms-and-php/)
 * I have a SEARCH option on my main (header?) menu.
 * When the end-user clicks on “SEARCH” I wish to do this:
 * if (is_user_logged_in() )
    { [ivory-search id=”3831″ title=”SUBSCRIBERS-search_v2]}
   else { [ivory-search id=”6411″ title=”VISITORS-search_v1″] }
 * My Q is this:
    The shortcode will be [php_everywhere instance=”1″]. How do I 
   keep track of, and/or view all the instances so I know I am calling the correct
   piece of code? Is there a way to list these instances?
 *  I found another plugin called “Shortcodes in Menus”. I would eventually
    like
   to use this plugin so I can call the php_everywhere shortcode when “SEARCH” is
   clicked.

The topic ‘Conditional search-forms and PHP’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-everywhere_5f7aae.svg)
 * [PHP Everywhere](https://wordpress.org/plugins/php-everywhere/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-everywhere/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-everywhere/)
 * [Active Topics](https://wordpress.org/support/plugin/php-everywhere/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-everywhere/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-everywhere/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 0 replies
 * 1 participant
 * Last reply from: [sputtering](https://wordpress.org/support/users/sputtering/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/conditional-search-forms-and-php/)
 * Status: not resolved