Without seeing your code it is impossible to be sure, but my guess is that you’re echoing the output of your shortcode instead of returning it.
function my_shortcode($atts){
//do shortcode logic
echo $result; //This is wrong and would do what you describe.
}
function my_shortcode($atts){
//do shortcode logic
return $result; //This is what you should do instead.
}
If you have to echo within the plugin you can do this.
function my_shortcode($atts){
ob_start();
//do shortcode logic
return ob_get_clean();
}
That function will store all your echo
to the output buffer and then return that buffer as a string.
Related Posts:
- is_plugin_active function doesn’t exist
- Get plugin directory from a theme
- How to call a plugin function from index.php
- Rewriting every url
- Where can I find a schema of wordpress plugin core architecture?
- How can I make my custom shortcode work in a Custom HTML Widget?
- How Does WordPress Uninclude/Deactivate A Plugin?
- How to un-attach rich text editor from named textarea elements
- how to not show plugin in admin area
- Memory Leak in plugin action
- Getting User email on logout. wp_logout
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- How can I add a custom meta value on file upload?
- Can a plugin add to header/footer/body content?
- Admin-ajax.php is dying “0” without processing function
- How do I register a stylesheet inside a WordPress widget?
- Add a Custom Permalink option in the Permalink Admin Screen?
- How to remove an Ajax action
- How Can A Plugin Hook Itself To the End of Every Excerpt?
- Allow Facebook to preview posts before published
- Has anyone used require.js for handling plugin scripts?
- publish_post plugin hook doesn’t always pass $post->post_content
- Multiple files in a plugin
- Let user subscribe to specific categories
- adding a new value to a serialized array in WP_option table
- add action for displaying posts using a shortcode
- Write to / remove from default .htaccess file from plugin?
- Best way to hook a custom url?
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- What is the best way to mimic a search query within a plugin
- Remove rewrite rules generated by plugin during deactivation
- How to load plugin after page is loaded – pagespeed issues
- Programatically download a plugin
- Do action only on certain front end pages?
- Call to a member function have_posts() on a non-object on normal loop
- Archive – same title for the first two posts
- Creating plugin using simple_html_dom parser?
- Not able to add option in Sub-Menu under page
- Create a navbar filter that filters by a custom field
- wp.media javascript issue with on select
- jQuery for custom plugin not working with Divi theme
- add tabs in rdp-plugin/includes/settings.php and get settings saved
- Creating shortcodes in plugin
- Change plugin name on WordPress repo
- Create a plugin from within WordPress
- Does a blank plugin come with any overhead?
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- Are plugins instantiated on every request to WordPress?
- Render content of multiple pages and their descendants
- adding a button to the media uploader
- Why WP_Screeen doesn’t show all options with admin_body_class
- How do I add $_SESSION[”] to my wordpress page?
- Plugin Activation Error – The plugin generated 22 characters of unexpected output during activation
- Search users with custom meta data
- Calling a class method instantiated by ajax call in wordpress [closed]
- Woocommerce plugin – How to create two versions of the same plugin with slightly different implementation for different users
- Error using wordpress functions inside a plugin class
- How to Join wp_posts & wp_postmeta table using custom query
- Use localized plugin name and description even when the plugin is disabled
- Cron: Update four post at Hour
- submit two file input fields in the same form
- Unexpected character and syntax error on wp-includes/formatting.php [closed]
- Error datatable whit ajax
- Cron task gets removed from the schedule
- working code, not working – Plugin Dev
- category page multiple products add to cart any plugin available for woocommerce
- “Enable Media Replace” plugin does not update serialized object in WPMeta
- One time call to external API in widget
- Is it possible to change plugin’s Admin Panel Url?
- echo plugin results on pages
- register_activation_hook doesn’t fire at all
- WordPress scheduled event not working
- plugin_dir_url(__FILE__) searches parent theme in ACF extension
- My ajax request don´t work and return 0
- My plugin can’t see my files
- Confusing problem with displaying message recipient metadata
- Choose default template for a page with code
- Custom Page Templates for a complex application – code must sit in a plugin and not the Theme
- Use functionality in third-party plugin in my own plugin
- Force Network Activated Plugin to Run After Site Level Plugins
- I want to add facility to add country, State, City in my custom plugin
- The plugin generated XXX characters of unexpected output…help?
- Template redirect inside of plugin not redirecting
- Validating values using Settings API?
- Cannot Search | Featured | Popular | Newest | Favorites in wordpress working
- Display WP Start bar on front page only
- How to call uninstall.php?
- WP-Snap too slow (caused by WP_Query?)
- WordPress Meta Query: Relation is not working correctly
- What is the source outline for a basic word press plugin?
- Submit posts in two different post types with the same form
- Load css classes after using ajax calls
- contact form 7 captcha support anyother captcha plugin? [closed]
- Update Content for a Custom Block Toolbar Button
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Wrong block appender button showing
- Uncaught Error: Cannot use object of type stdClass while showing the list using WP_List_Table
- WordPress Throwing Deprecated Errors on its own Files
- plugin doesn’t retrieve data from database
- Display Any Field fromAdmin Panel in Frontend via Shortcode?