Support » Plugin: AmazonSimpleAdmin » 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

    The page I need help with: [log in to see the link]

Viewing 2 replies - 16 through 17 (of 17 total)
  • I can assure you that at the user’s side there are no line breaks. Neither in the CSS, nor in the template, nor in the text where the shortcode is inserted.

    Like I said, the </p> tag comes between the closing </style> tag of the custom template’s CSS and the opening <span> tag of the custom template’s HTML. I cannot think of any instance that would interfere at that point of the output.

    Let me know if you found something!

    Cheers,
    Sascha

    Plugin Author Timo Reith

    (@worschtebrot)

    Thanks for all the details. I will let you know as soon as I will work on an improvement for this issue.

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘How to avoid new paragraph tags before and after shortcode’ is closed to new replies.