I solved my own issue.
I needed to filter out all the <br>
and white space between my shortcode tags. WP was auto adding breaks which my functions was adding to the output of my shortcode. So I used the strip tags function to filter the $content of my shortcode
$content = strip_tags($content);
I added this to my shortcode function and it worked like a charm!
Thanks to the people who pointed out the potential issues with the previous answer.
Related Posts:
- Adding body class when post contains a specific shortcode
- Super simple shortcode not working
- Native gallery custom html output
- Customizing the wp_video_shortcode output with add_filter
- Hide disclaimer from summary excerpts
- Shortcode to eliminate and replace with
- Problem in outputting shortcode
- remove empty paragraphs from the_content?
- Solution to render Shortcodes in Admin Editor
- Issues with title-tag and document_title_parts
- Remove Actions/Filters added via Anonymous Functions
- Use AJAX in shortcode
- Set JPEG compression for specific custom image sizes
- Define custom Page Template without its own .php file
- Add class to menu items of one specific menu (nav_menu_css_class)
- Include PHP file in Content using [shortcode]
- How to influence the information displayed on widget inside wp-admin
- Removing default image size list in Media Box
- How to restrict actions and filters “properly” by conditions
- Filter the query ONLY for the search results page
- Shortcode producing headers already sent error
- How to add attributes to a shortcode
- How to display random users with avatars
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Using add_filter() in Widgets
- Customize WordPress Media Manager – Media Window
- Enabling shortcodes for custom fields
- How to reduce original image quality on upload?
- Is it possible to use a forgot password url filter?
- syntax for remove_filter in parent theme with class
- Add body class of category parent
- How to use get_media_embedded_in_content function
- Can shortcodes contain conditional statements? Even without them my shortcode renders blank page
- Shortcode with parameters inside parameters
- Creating a table from shortcode avoiding wpautop for each row
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Convert hyphen to underscore in permalinks
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- Override parent theme function that is not hooked or in the functions.php file
- Remove Page Title from Static Frontpage
- Stripping shortcode from custom excerpt function
- Programmatically Add Font-Awesome Icons to Category Widget
- how to create shortcode in wordpress
- What is wrong with this Shortcode? I get it in a wrong place inside the content
- Display random text from a file with the WP built-in AJAX API
- Remove bulk actions based on user role or capabilities
- Set first oembed in post to a global variable or function
- Formatting post content to exclude gallery
- Default or Preset Content for Custom Post Types
- Remove images from get_the_excerpt
- Shortcode with custom content attribute?
- Override a class function to include a custom template
- Problem with extract() with custom shortcode
- How to override filter in child theme?
- Shortcode to insert menu in page body?
- Removing title from page
- Hide some items from Screen options in dashboard for products
- How to change a certain text or term of WordPress into a custom into the whole site?
- Using locate-template & shortcodes doesn’t appear to work
- Displaying a random user with a shortcode
- Passing HTML in WordPress Shortcode arguments
- Replace Archive Widget Link Text
- Exclude Empty Child Categories in Menu
- Function to show only first instance of shortcode
- Display a text message if the shortcode is found?
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Best way to programatically add “rel” attributes to page and post images
- add_filter priority problem
- Limit filter upgrader_post_install to a single plugin
- How to update feed only 2-3 times a week (for Feedburner email)?
- Manipulate Output of wp_list_something: select menu instead of li’s
- Clean-up script tags
- How to use IF Statement in WordPress?
- creating shortcode to pull json array
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- Show excerpt for only first post in query
- Custom Shortcode, functions PHP WP_Query loop
- Remove function or filter
- modify a function filter
- Pass Shortcode Attribute to footer Script
- How would go about if I just want a temporary function?
- Generating rel=prev and rel=next only on wordpress categories
- How to make applyFilters function return false via functions.php
- Detect Safari desktop browser and include the detection in a shortcode
- How to filter out shortcode when displaying the_excerpt() in the loop?
- My simple custom shortcode is not longer working (possibly due to upgrade to WordPress 4.4 ?)
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- Display gallery on top before content
- List child pages of specific page using shortcode
- Which action hook to use for function?
- Adding multiple taxonomy filters to functions.php
- str_replace function in theme
- How to extract the variables out from “add_shortcode” function?
- Display first name of logged in user?
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- How to get specified parent page title in my function
- Adding HTML to the end of every post with the Block Editor
- Last updated date function