That’s a common mistake, Shortcodes should return
values and not echo
.
Remember, the Codex is your Friend 😉
Shortcode_API#Output
Output
The return value of a shortcode handler function is inserted into the post content output in place of the shortcode macro. Remember to use return and not echo – anything that is echoed will be output to the browser, but it won’t appear in the correct place on the page.
Related Posts:
- Where to store PHP files created by plugin / themes
- Getting a WordPress Debug Strategy
- Setting a post’s category
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How to get the path to the current theme?
- Why does WordPress use outdated jQuery v1.12.4?
- Get page content using slug
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Where do I start from
- Check for featured image in WP_Query
- Update exisiting site to 3.5 release candidate
- Get file headers in custom file
- add_filter and remove_filter added before and after wp_query
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- Having Problem On Getting WP Post Gallery Images URL
- Two-step login process – Is it possible?
- How to: get main plugin/theme file?
- add_theme_support using a plugin
- How to bundle a plugin with a theme, or vice versa
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- Best choice of options/settings framework for plugin/theme development
- Is there any way to have Featured Text, as opposed to Featured Image?
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- Find source of notice / warning / errors efficiently
- StackExchange clone using WordPress?
- Sharing common functionality (functions, template parts) between plugins and themes?
- Change template dynamically
- Display content from custom post without modifying the single template
- Can I change header.php of current theme through a plugin function?
- Applying OO patterns and principles to plugin development
- Tried in different ways but sidebar not working?
- Short code not working in boostrap modal dont no why?
- Is there a way to list all actions registered by a plugin or theme?
- Hide categories that are not used in the post type
- How to hook a custom user function to a wordpress core ajax action?
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- WP Gutenberg Blocks – How to limit first/root blocks
- what is the best practice to add new field to an api route
- How developed with version control word press site on shared host? [closed]
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- How do I create plugin or theme using MVC pattern?
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- How to Get Current Custom Post Type Associated Taxonomy Term
- Plugin templates vs Parent Theme
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- Plugin is not generating title tags on any pages or posts
- Is it necessary to do validation again when retrieving data from database?
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- get_the_tags with separator control?
- 400 Bad Request, in wordpress theme development, wp_ajax
- Add child pages to submenu automatically
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Why would you use esc_attr() on internal functions?
- How to add the sidebar to all the pages except the home page? [closed]
- How to find where an object first instantiatiation
- Full documentation about $args for register_rest_route?
- Removed jQuery script from header.php , any problems?
- How to replace settings in WordPress plugin from a theme
- Save temporary registration data
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- post content and shortcode content displaying out of order
- How can the_excerpt (or equivalent) be called on a category description?
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- How to access index file in Block Themes?
- How to change basename url for wp-admin?
- WordPress Favicon not Working For Images/Videos/PDFs
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Redirection from a specific page for users logged in but not with membership
- Rename a folder via HTML POST request
- How can we stop showing short code in create or edit post section
- Submit remote form to wordpress REST API and save data to custom post type
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- Add a custom link to each image in WordPress gallery
- register dependency css and js inside a plugin class
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- set a custom post type to a taxonomy term programmatically in metabox
- Custom premium registration form and profile page for a WordPress Web Application
- How to destroy or dispose wordpress uploder/manager?
- Font Awesome stopped showing icons, shows &# text instead [closed]
- To remove rendering of menus and header, plugin or theme?
- Managing Custom Designed Content
- How can I add recent posts to menu like mashable
- Generate activation url
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Display Data’s metabox in page
- Ajax functions – no access to wp-admin.php only online
- Saving multiple fields as array
- How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?
- Gutenberg text field validation
- How to get the value entered in the input field in wordpres
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?