For the sake of having @Milo’s comment as an answer. Your code works as it should, it is just not possible to “write” HTML in the visual editor also in shortcodes. Shorcodes are not treated differently then any other text.
If you want formatted HTML in your shortcode you just need to use the normal visual editor formatting tools, or switch to the text editor.
Related Posts:
- Shortcode content output but not in correct place
- How to manually fix the WordPress gallery code using PHP in functions.php?
- How do I change/modify the_post_thumbnail(); html output?
- start_lvl Ignored in Custom walker_nav_menu
- Modify previous and next text from pagination links
- Shortcode putting html such as
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Calling a method from functions.php on a click of a button
- Shortcode created to check language not works
- Add/echo div with Analytics-Code to function in functions.php
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- How can I default to all WordPress roles when parameter is not included in shortcode?
- WordPress menu deletes when trying to add a hook
- HTML table from shortcode with multiple parameters
- Recent post display using shortcode
- Nested shortCode functions in the functions.php file
- Making Quote Plugin more efficient
- Slide in Panel WordPress Post
- is_page “range” for if statement?
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Removing unneccessary p-tags (Not every p)
- Shortcode content filter?
- Trigger popup in a php if/else statement
- Add a class to the anchor tag on HTML5 gallery
- How to output a PHP file values by shortcode?
- Showing content from one page on another
- Converting HTML Template to WordPress Theme
- Populate dropdown with Child Pages based on Parent Page chosen
- How to store data from multiple forms using ajax and php
- Get value from shortcode to do something
- Use DOMDocument with ob_start breaks my HTML code
- Custom shortcode outputs plain text instead of HTML at top of post
- How create a Shortcode with hover and complex options
- How to Reference/Echo Variable from Another PHP Function
- Add .htm extention to a custom taxonomy
- Noscript not working as it should in wordpress site
- Shortcode with PHP issue “Undefined index”
- How to make modifications only to certain elements of an HTML string on the server-side?
- Shortcode from a function not working
- Display Data in Table from External Database in WP using Shortcodes
- Is it possible to return content, and then also continue to do other things?
- Widget back end radio button issue
- ::before on open/close function [closed]
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- Creating WordPress Shortcode with Variable
- calling a custom field value inside functions.php
- Using ob_start and ob_get_clean with wordpress shortcode
- List all blogs, but exclude the main site
- Shortcode for Listing Users from Meta Value?
- Cant display an image via PHP in wordpress
- Adding function to child theme’s function.php
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- How to use the checked() function to check for a non-empty var
- Calling function in loop causes repeat data
- Calling PHP Titles inside Javascript Markup
- How can I use custom menus with a Bootstrap WordPress theme?
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- how to changes mobile menu toggle breakpoint in WordPress
- Updating Metadata with Shortcode
- WordPress User Meta value variable into Google Gauge Chart
- Display logged in user name and lastname on page
- Create shortcode for metabox gallery
- Display Visual Composer shortcode if a post belongs in specific categories
- PHP function for horizontal Woocommerce thumbnails and badges
- How to use data URL in WordPress?
- HTML comment cause issue in functions.php script root
- couldnt show short code atts in category
- How can I prevent a shortcode div from extending beyond its boundaries?
- Remove span tags from WooCommerce Downloads page
- Display a custom name when the user has no name settle in his account
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- How can I edit the final HTML structure of the whole web page
- How to return html as a string from php for WordPress
- Display current user metadata on WordPress page
- Reload page with a different shortcode when a user selects from a dropdown
- How can I create a shortcode from an html and php code written together
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Offset with ajax load more posts duplicates
- Shortcode’s output to use as other shortcode’s parameter
- Open/closed function [closed]
- Need to Echo A Url path to show on a wordpress page
- Can’t get_users info by using json_encode
- Wrapping shortcode content in a span or link
- Need help with PHP functions
- WordPress HTML Helper
- How to have Function of a plugin using global vars into a shortcode?
- Overwriting a Shortcode
- Shortcoding with Divs
- Cant get theme to change footer color through theme customizer
- Whats wrong with my code? Need To add String to shortcode? [closed]
- My title is showing after the shortcode
- A next page function with shortcode?
- Shortcode to include PHP file, pass various parameters to include?
- Sorting Problem
- Is there a better way to output HTML as a shortcode?
- WP Custom tables query
- Add multiple HTML attributes to an Elementor button
- How call WordPress shortcode inside function file
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)