You are returning the result of calling include
. You want to grab the output of the included file and return than instead. Use output buffering to do that.
function build_total_search_method( $atts ) {
ob_start();
include( dirname(__FILE__) . "/includes/total_search.php" );
$shorcode_php_function = ob_get_clean();
return $shorcode_php_function;
}
add_shortcode( 'total_search', 'build_total_search_method' );
Related Posts:
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- Confused about shortcode and settings values
- Running jquery script after shortcode [closed]
- How to put JQuery/Ajax inside shortcode?
- Can someone please tell me what is wrong with my plugin?
- WordPress function not being called from jQuery method
- Create shortcode to echo javascript
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- How to prevent tabs from opening all at once
- Load CSS files in header of Bones theme?
- JS working when used normally but not in wordpress
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Display file contents within Plugin
- Pass PHP variable to javascript
- is_plugin_active() returning false on active plugin
- Unable to check if plugin is active
- How to include a plugin’s php file to another plugin functions file [duplicate]
- Help making my pagination plugin better
- Is dynamic forms/entries possible in Widget?
- shortcode doesn’t work
- How to load default scripts included with WordPress correctly?
- Layout shop page: resize images and columns
- How to add inline css/js inside a shortcode
- How extend shortcode default values for a plugin?
- Ajax with jQuery UI dialog not working
- Shortcode in AJAX popup
- Can I use a Shortcode output as an HTML attribute value?
- WP theme with Backbone
- Force [wordpress_social_login] shortcode to display where it is embedded [closed]
- scrolltop always 0, can’t trigger script
- Bootstrap Drop Down menu is not working
- tag breaks shortcode output (other solutions don’t work)
- Allow users of my plugin to define their own shortcode rather than use mine?
- wordpress site | All-in-one-cufon IE Issue
- add_shortcode is not working in plugin where others are working
- How to hide CSS by default and show on button press
- Some code in shortcode function being ignored
- jquery tinymce and bundled wp plugins
- Using window.onload with Ubermenu
- plugin shortcode output
- How to Create a shortcode to this php function
- Jquery plugin not working on single pages
- What is @Action in WordPress?
- How to include this jQuery File in wordpress?
- Where are theme codes located for WordPress?
- a weird attribute on every html tag
- How to have sample page for each new register users in a membership website
- using do_shortcode
- How to add an element right after the article using jQuery?
- plugin shortcode not working on ajax request call
- Modify page title and subtitle with a plugin
- Add Shortcode tag in Widget/Sidebar
- JQuery prepend a function
- WPTouch – how to remove shortcodes or make shortcodes function
- I changed .live() to .on() but change is not reflected on the server
- Custom shortcode for displaying user based on a role parameter
- WordPress Plugin Insert Html Code with Shortcode
- Save user total active time after login in wordpress [closed]
- Get all the URLs of the pages that uses a specific shortcode
- Why does my jQuery plugin show up as text in WordPress?
- Disable submit button order
- jQuery code didn’t run on my plugin
- The Events Calendar Plugin – List View Background Colour Issue [closed]
- how to check if a shortcode is used more than one time in the same post
- Rename Smart YouTube’s httpv back to http for all posts
- Pass PHP variable to javascript
- How to use a shortcode or an application to dynamically embed content from one WordPress site to another?
- wc_get_template_part doesnt display the content [duplicate]
- Managing and deleting transients with dynamically generated transient names
- Thumbnail image doesn’t show up in Shortcode output
- list of custom post by custom field in frontend
- get_post_meta shortcode returns empty field
- Cannot pass value variable to WP AJAX functions
- How to properly enqueue jQuery knob on WordPress without conflict?
- How to get a specific string from a url
- Does anybody know how to insert a complete jquery plugin into a wordpress elementor-page?
- Make the product page as homepage WooCommerce
- WordPress Shortcodes – Return $Variable
- shortcodes not working [dt_carousel & [dt_fancy_image
- Get Current Post ID in WP Loop For GiveWP
- WordPress Thickbox Navigation Issue in Gallery
- Not displaying Woocommerce product page in lightbox
- show-hide based on select option jquery wordpress
- wordpress Shortocode running twice?
- Shortcode in a blog post, footer and related products stop working
- Using “excerpt_more” filter for a specific post type
- Shortcode registered from a plugin not recognized
- show Visual form builder in the front end
- Strip shortcode from excerpt [duplicate]
- Element works, but not on wordpress site [duplicate]
- Embedding BitBucket Code in Posting
- Do shortcodes affect page indexing by search engines?
- White Screen When Includding A Folder With PHP Files
- How to show in front End images using Visual Composer attach_images?
- Javascript as Jquery Function Call?
- JQuery UI plugin not working in IE7?
- Jquery based image accordian plugin
- wordpress jquery is not defined because the head tag is empty
- Seo Problems in My meta Discription [closed]
- cURL External API request displays content above other content on page