• I’m running into an issue and I’m not sure I’m just misunderstanding how the options work or what.

    I’ve tried adding the clean=”true” and strip_tags=”true” options to my loop and neither seem to be removing the <p> tags from the loop output.

    Strip_tags did seem to pull out the ‘a’ tags that I manually added but still the automatically generated ‘p’ tags were still there.

    https://simplify.bi/wp-content/uploads/2014/03/p-tags.png

    code that I’m using:

    [loop type="post" count="4" clean="true" taxonomy="post_format" compare="NOT" value="post-format-link"]
    <h3 style="margin-bottom:0px;"><a href="[content field='url']">[content field="title"]</a></h3>
    by <a href="[content field='author-url']">[content field="author"]</a> on [content field="date" date_format="F j, Y"]
    [content more="true" words="50"]
    [/loop]

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter williamweber

    (@williamweber)

    A little more testing and I’m finding that when I add both clean=”true” and strip_tags=”true” the ‘h2’ tags and the ‘a’ tags stripped from the first post in the loop but then they show up fine in the rest.

    I can replace the ‘p’ tags around the main [content] item by including a class but even there the still get a ‘p’ tag around the Read More link.

    What I want to do is basically have a blank slate to work with where I can add my own ‘p’ or ‘br’ or even ‘div’ tags into the loop so that I can format things exactly the way I want with some simple CSS.

    Plugin Author Eliot Akira

    (@miyarakira)

    I just updated to version 0.8.1. I hope I got all of them working as they should.

    Thank you for pointing out this issue. I’ve gotten used to having a plugin called Raw HTML – which pretty much eliminates the problem of WordPress auto-formatting shortcode content in the text editor. Also, I mostly work with the code outside in separate files, so I hadn’t tested the clean, strip_tags and allow parameters in a while.

    Anyway, I believe I corrected their behavior. Please let me know how it works for you. I think for your purpose, clean=”true” should do the trick. If all goes well, you won’t have to put everything in one line.

    Mmm, you know, after more testing, I think it might need a little more work. I hope the next update will get it down.

    Plugin Author Eliot Akira

    (@miyarakira)

    So, I’ve made another update, with adjustments to the formatting parameters: clean, strip_tags and allow.

    If these are not enough, I would recommend the plugin Raw HTML – but, as far as I’ve tested, the formatting parameters should be working correctly now.

    Thread Starter williamweber

    (@williamweber)

    Still a little sporadic in how tags are removed or applied. The strip_tags and allow options seem to work correctly. The clear option is the odd one. I’ll investigate the Raw HTML plugin and see if that gets me there.

    Thanks for all your work.

    Plugin Author Eliot Akira

    (@miyarakira)

    OK, thanks for the feedback – I’ll keep working with these parameters – especially clean – to see if I can improve their function.

    Plugin Author Eliot Akira

    (@miyarakira)

    Hello, just wanted to mentioned that in the latest update, I worked on improving the clean parameter, so all <p> and <br> tags should be removed.

    I also added it as a shortcode, so if you’re not using the loop (or to apply it to part of a loop) this is possible: [clean]...[/clean].

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘clean and strip_tags loop options not working as I expect’ is closed to new replies.