How to avoid new paragraph tags before and after shortcode
-
Hi,
I have created a custom template for textlinks to amazon products, which I want to show within my texts. In pages this is working fine, as expected.
However, in blog posts the same short code gets a closing </p> tag before it and an opening <p> tag after it, so that my textlink, which is supposed to be in the same line as its surrounding text is now in a separate line.
How can I make this work in blogposts, too, to keep the shortcode output in line with the surrounding text?
Compare the blogpost
https://hundebetten.shop/warum-kratzt-mein-hund-in-seinem-bett/#buchtipp (not working)
with the page
https://hundebetten.shop/bestseller/#comfort (working)Again, these links are created with the identical shortcode.
I already tried to add the lines
remove_filter('the_content', 'wpautop'); add_filter('the_content', 'wpautop', 12);
to my functions.php, but the only effect was that it made the problem appear in the page, too.
Thanks in advance
Sascha- This topic was modified 4 years, 8 months ago by .
- This topic was modified 4 years, 8 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘How to avoid new paragraph tags before and after shortcode’ is closed to new replies.