WordPress.org

Ready to get started?Download WordPress

Forums

Remove tags around shortcodes (1 post)

  1. kmk293
    Member
    Posted 2 years ago #

    As we all know, wordpress automatically inserts <p> tags around our code. I was having an issue because <p> tags were being placed around a shortcode for a search function for a plugin I was using (WP eStore...great ecommerce plugin by the way if you're looking for one. The support is truly amazing.) When the search function returned a table of results, the very first link in the table wasn't showing up as a hyperlink. I contacted the creator of this plugin (www.tipsandtricks-hq.com) and they said that the <p> tags were screwing up the shortcode.

    Now if anyone has ever tried to remove these tags, they know what a pain in the rear it is. But I finally figured out a workaround with no special code or plugin. Here's what I found out:

    First I disabled the WYSIWYG editor.

    Then I discovered that by removing the text I had on the page prior to the shortcode, the issue was gone and the <p> tags were removed! I added the text after the shortcode and it still worked!

    I just wanted to post this in case someone else runs into this issue, it took me 2 days of installing/uninstalling plugins and editing code to finally figure this out. I hope this puts a smile on someone's face!

Topic Closed

This topic has been closed to new replies.

About this Topic