Instead of trying to remove the automatically added paragraphs before or after the fact, you can try removing the wpautop
filter from the_content
within your shortcode (and re-adding it to maintain consistency for other plugins etc.):
add_shortcode( 'test', 'test_sc' );
function test_sc( $atts ){
remove_filter( 'the_content', 'wpautop' );
$content = apply_filters( 'the_content', '$\frac{15}{5} = 3$' );
add_filter( 'the_content', 'wpautop' );
return $content;
}
Related Posts:
- Autogenerate wordpress shortcodes using array?
- Shortcode display outside the div
- Shortcode under a Shortcode Multiple times Possible?
- Trying to count the total number of paragraphs inside a blog article
- May i Use ShortCode in Template?
- Adding Shortcode to Text Widget
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- creating html reusable blocks via shortcodes
- Nested shortcode functions accessing variable
- Calling an attribute from a plugin shortcode
- Redirect to another page using contact form 7? [closed]
- What is @Action in WordPress?
- Return multiple values in a shortcode attribute
- Shortcode Attributes to Return different $_POST
- strange shortcode error: does shortcodes requires any dependency?
- Add the_post_thumbnail_url to a shortcode in function.php
- Adding a Tag Parameter / Filter to My Shortcode
- grab or load text on demand
- Elementor Pro display featured image on section -> style -> image using shortcode
- How to get current cart values using WC_Shortcodes?
- Get Shortcode output to database for static post_content
- Find all strings between an enclosing shortcode
- wordpress Shortocode running twice?
- Posting code inside the post instead of in the template file using shortcode
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- PHP Deprecated: Non-static method should not be called statically
- How to handel multiple checkbox field in the admin settings page with Settings API
- Loading shortcode with ajax
- wp_insert_user – how to send verification email before logging in
- Is the WordPress HTTPS Plugin Still Safe To Use? [closed]
- Post source link plugin – small modification
- How to pass multiple values in shortcode?
- How do you auto-activate plugins from child themes
- Calling function from within functions.php returns unwanted value
- Code in theme functions.php faster than with a plugin?
- Nested shortcodes
- Override the core function locate_template
- How Can I Pass the Shortcode’s $atts Variable to the Plugin’s Javascript Function
- Pass info from functions.php to plugin
- add_query_arg not working
- How to stop or remove an action being called inside a function of an extended class
- Date calculations from 2 custom fields
- How to debug error message: Cannot modify header information
- How to enable specific plugin only based around shop manager role?
- How to add an automatic refresh in WordPress for a Page/Post or an embedded OneDrive/Excel HTML Code?
- Adding a new field to the address field type in gravity forms
- accessing wp.media api from a tinymce plugin
- Visual Composer shortcode for child theme dir
- Create shortcode to echo javascript
- Custom Shortcode Broken in WordPress 3.1
- Namespaced shortcode?
- How to get plugin name from plugin file location
- Checking the count within a foreach loop
- Create a post builder skin in a plugin
- Shortcode does not expand in Facebook like
- Need to replace Currency Shortforms
- add_query_arg not work in admin
- How do I create a custom permalink structure for a page template
- How to remove a class function from a plugin by using remove_action()?
- Api external with wordpress
- How to get rid of Ellipsis on Woocommerce [Essential] Theme [closed]
- Is there a good way to load tiny_mce_popup.js through editor.windowManager.open?
- Sharing functions between plugins
- How to prevent tabs from opening all at once
- Executing Javascript in Plugin
- How To Use do_shortcode with WooCommerce One Page Checkout
- implement custom roles in custom plugin
- Can I add Short Code Of A Plugin In The Code Editor of WordPress?
- insert og image link in wordpress post
- How to copy the all WordPress media items to another custom plugin folder?
- WordPress default post categories meta box widget
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- How to check if short code is present in template?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Why is my shortcode not working?
- Make modification of add_to_cart button specific to single page
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- how can export data in excel file custom plugin
- WP_CRON issue with UTC and local time
- WordPress show descriptions under images in gallery
- Modify Plugin PHP Class in Child Theme – Correct Method
- Unexpected plugin_dir_path Output
- function of parent not working in childtheme
- how to repeat taxonomy in different places on wordpress
- how to create table during plugin installation in side a class
- Why function hooked using object are executing at all time?
- Metabox Data not saving
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Including a PHP file via a function that is part of a plugin?
- overwrite a plugin function in functions.php
- Pass strings to plugin function [closed]
- Trying to Understand Shortcodes.
- How to tweak a plugin without preventing it from updating
- Any way to hook into WP after a page displays?
- Display Video as Post Thumbnail
- Notifications Bar on home page only
- Shortcode to do math with url variables
- Buffered output in chunks and shortcode – how do I achieve that?
- wp_enqueue_script doesn’t load JS in plugin