is there a WP plugin to display post's html when using shortcode?

Discussion in 'Web Design and Development' started by patent10021, Jun 19, 2014.

  1. patent10021 macrumors 68030

    patent10021

    Joined:
    Apr 23, 2004
    #1
    as you know WP does not display html from content or excerpt fields when using short codes to display posts on pages.

    Is there a plugin to hack this limitation?
     
  2. 960design, Jun 20, 2014
    Last edited: Jun 20, 2014

    960design macrumors 68020

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #2
    That's a pretty bold statement. A shortcode is written by a developer, it could be written to do anything.

    What are you looking to do exactly? Display code within a single text area but force all other html to render properly?

    You could write your own shortcode that uses a php function like: htmlentities() and a <pre> tag to keep your indentation, so something like:
    Code:
    $yourStuff = "the html coded stuff would get added here";
    $showCode = htmlentities($yourStuff, ENT_QUOTES);
    return <<<HTML
    <pre>$showCode</pre>
    HTML;
    
    htmlentities turns html code into their entity form so <bob> becomes something like this <bob>
     

Share This Page