Title: embed shortcode php file
Last modified: August 27, 2020

---

# embed shortcode php file

 *  [stkontra](https://wordpress.org/support/users/stkontra/)
 * (@stkontra)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/)
 * Hi,
    Is there a way to use the shortcode in a php file? Say I want to include
   a search field in the header.php file. Many thanks in advance. Regards, Steven

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [LunaGraphica](https://wordpress.org/support/users/lunagraphica/)
 * (@lunagraphica)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/#post-13325515)
 * Use “do_shortcode()”
 * This is a standard function in the WordPress API:
 * [https://developer.wordpress.org/reference/functions/do_shortcode/](https://developer.wordpress.org/reference/functions/do_shortcode/)
 *  [frzdev](https://wordpress.org/support/users/frzdev/)
 * (@frzdev)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/#post-13326132)
 * [@stkontra](https://wordpress.org/support/users/stkontra/) Please try <?php echo
   do_shortcode(‘[searchandfilter id=”XXX”]’);?>
    Hope,It works.
 *  Thread Starter [stkontra](https://wordpress.org/support/users/stkontra/)
 * (@stkontra)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/#post-13328468)
 * Thank you guys. Yes, I should have thought about it. It worked.
 *  Thread Starter [stkontra](https://wordpress.org/support/users/stkontra/)
 * (@stkontra)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/#post-13328489)
 * Another problem.
    Is there a way to make the title search field search globally
   not only on the category page it is on? I know this plugin was meant to be a 
   filter, but the search works well with DIVI Theme Builder pages, where I can’t
   use woocommerce search widget as it doesn’t work. So if there is a way to even
   modify a php file of the plugin, or put in a snippet into the functions.php of
   the theme, I would really appreciate some help with it.
 * Basically all I need is to make the query string look like this:
    domain.com/
   shop/?wpf_page=1&id=kereso&wpf=1&wpf_termekkereso=sakk So start with /shop/ all
   the time, no matter what page you search on.
    -  This reply was modified 5 years, 7 months ago by [stkontra](https://wordpress.org/support/users/stkontra/).
 *  Plugin Author [themifyme](https://wordpress.org/support/users/themifyme/)
 * (@themifyme)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/#post-13336196)
 * [@stkontra](https://wordpress.org/support/users/stkontra/) – Are you referring
   to the Product Title module ([https://share.getcloudapp.com/ApukekeO](https://share.getcloudapp.com/ApukekeO)),
   it should be global (ie. it should search all products, not just the category
   that you are viewing). Could you post your site URL where we can see the issue?
 *  Thread Starter [stkontra](https://wordpress.org/support/users/stkontra/)
 * (@stkontra)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/#post-13354968)
 * For example if you search on this page for ‘sakk’ [https://gardos.anima-labor.hu/product-category/ajandek-holgyeknek/botok-ajandek-holgyeknek/](https://gardos.anima-labor.hu/product-category/ajandek-holgyeknek/botok-ajandek-holgyeknek/)
   
   But if you search for ‘sakk’ on this page, then all ok.: [https://gardos.anima-labor.hu/shop/](https://gardos.anima-labor.hu/shop/)
 *  Plugin Author [themifyme](https://wordpress.org/support/users/themifyme/)
 * (@themifyme)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/#post-13363784)
 * Hi Steven,
 * I did a search on both pages and I see the same results, please see this screen
   recording and let me know if I’ve missed something: [https://share.getcloudapp.com/04uq89X9](https://share.getcloudapp.com/04uq89X9)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘embed shortcode php file’ is closed to new replies.

 * ![](https://ps.w.org/themify-wc-product-filter/assets/icon-128x128.png?rev=1535808)
 * [Themify - WooCommerce Product Filter](https://wordpress.org/plugins/themify-wc-product-filter/)
 * [Support Threads](https://wordpress.org/support/plugin/themify-wc-product-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/themify-wc-product-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/themify-wc-product-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/themify-wc-product-filter/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [themifyme](https://wordpress.org/support/users/themifyme/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/embed-shortcode-php-file/#post-13363784)
 * Status: not resolved