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 Actions/Filters added via Anonymous Functions
- Use AJAX in shortcode
- Add class to menu items of one specific menu (nav_menu_css_class)
- How to influence the information displayed on widget inside wp-admin
- How to restrict actions and filters “properly” by conditions
- Filter the query ONLY for the search results page
- How to add attributes to a shortcode
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Using add_filter() in Widgets
- Customize WordPress Media Manager – Media Window
- Is it possible to use a forgot password url filter?
- Can shortcodes contain conditional statements? Even without them my shortcode renders blank page
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Remove Page Title from Static Frontpage
- Default or Preset Content for Custom Post Types
- Override a class function to include a custom template
- Display a text message if the shortcode is found?
- add_filter priority problem
- How to use IF Statement in WordPress?
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- modify a function filter
- 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
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- Which action hook to use for function?
- str_replace function in theme
- Shortcode pagination not advancing
- Modify a function without editing template
- Having issues with a foreach inside of a shortcode with ACF gallery
- How to add nav menu items to a specific position within a menu
- Disable auto-resizing of uploaded images, but only for certain filename
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Get Current Post ID in functions php, meta query filter
- Add to cart php not working [closed]
- Is possible add icon in title posts only in specific tag?
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- create filter in functions.php
- Insert image in WordPress with HTML5 tag and caption function
- How to construct function for applying filter?
- Display gallery on bottom after content
- Redirect to another page using contact form 7? [closed]
- WordPress Shortcode function display outside of widget
- Add Element as a Filter to the_content
- Can’t properly set the_title add_filter to show short_URL
- Shotcode argument issues
- (Woocommerce) Order by price when entering specific category
- Exclude category from shortcode
- get_pages() Returns Only One Item
- Adding an option to a shortcode
- How to use author meta in shortcode?
- Use a shortcode to display custom meta box contents
- Filter nav menu items HTML tags and wrap inner text with span
- How to add custom li item to wordpress menu
- Tracking the number of shortcodes for a list?
- Can I include a custom PHP function in a WordPress function?
- How to create a shortcode out of a php function
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Insert Content Before div#main from the functions.php File
- Changing the text of Upload/Insert on Posts and Pages Screen
- Conditional custom menu?
- Get URLs for AJAX Filter Checkboxes WordPress
- Need help making a short code work
- Using One Function To Create Two Different Shortcodes
- How to display an image before title text in menu items
- Filter works on last selection but no others
- page shows short code not output
- Last updated posts shortcode in functions.php
- Add #primary at the end of navlink permalinks on single posts
- Reload page with a different shortcode when a user selects from a dropdown
- Prevent function from triggering on current page
- Assign IDs to headings in ACF using functions.php
- Redirect specific author posts to another url
- How to retrieve image IDs from shortcode content?
- Display list of pages that contain a certain string within the slug
- $content is empty while using DOMDocument
- HowTo: Add wrapper to columns shortcode?
- How To Show Shortcodes In WordPress Custom Fields?
- Best way to add image to recent posts widget?
- Retrieve a custom form field modified by a filter
- Print all inline styles to head
- How to display data from custom fields in my custom shortcode?
- Modify function Shortcode_atts
- restrict access to specific urls on a specific period of time
- Function Reference for custom link in Admin Menu Management Page
- Add title & subtitle to shortcodes
- shortcode inside post called by ID does not render as expected
- Trying to get this function to show below the content
- Display function from functions.php in tag.php
- multible shortcodes (for differnt values) with one function
- function to show youtube videos within excerpt – if condition and apply_filters