WordPress.org

Ready to get started?Download WordPress

Forums

Allow PHP in Posts and Pages
[p] is showing in my page but [/p] works (5 posts)

  1. ddowdall
    Member
    Posted 1 year ago #

    Hi,

    I just installed your plugin today and was testing it out. I found that the open paragraph [p] tags are not replaced.

    I tried messing around with it but every time, the [p] is showing in my page but [/p] works and turns into </p>. (and of course the </p> is not visible)

    foreach ($membernames as $member){
    echo '[p]'.$member['First'].' '.$member['Last'].'[/p]';
    }

    [p]John Doe1
    [p]John Doe2
    [p]John Doe3

    D

    http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

  2. JamieFraser
    Member
    Plugin Contributor

    Posted 1 year ago #

    Hi D,

    It could be that the use of the extra square brackets is confusing the parser, try splitting it into 2 lines instead:

    foreach( $membernames as $member ){
      $name = $member["First"].' '.$member["last"];
    echo "[p]".$name."[/p]";
    }

    Thanks
    Jamie

  3. ddowdall
    Member
    Posted 1 year ago #

    Hello Jamie,

    Thanks for your reply.

    I changed the code as you suggested but the output was the same. I then removed all my other code to see what would happen.

    Code:

    [php debug=1]
          $name = "test";
          echo '[p]'.$name.'[/p]';
    [/php]

    Output:

    [p]test
    Allow PHP Debug
    
          $name = "test";
          echo '[p]'.$name.'</p>';
    End Allow PHP Debug

    I have wordpress version 3.5 installed.
    I have Allow PHP in Posts and Pages version 3.0.3 installed

    Thanks,
    D

  4. barnomics
    Member
    Posted 1 year ago #

    I'm having the same problem.

    I do put [/p][p] WITHIN my string and it will work. But something like this below DOES NOT WORK!

    echo "[p]";
    echo $original;
    echo "[/p]";

    even trying this does not work.
    echo "<p>";
    echo $original;
    echo "</p>";

    FINALLY got it to work by doing this ( with &lt and &gt but the code below does not output correctly here on wordpress.org

    echo "<p>";
    echo $original;
    echo "</p>";
  5. gverhaeg
    Member
    Posted 7 months ago #

    I use your plugin version 3.0.4 on wordpress 3.5.1

    I code :
    begin
    [php]
    echo "<p>";
    $original = 'Hello World';
    echo $original;
    echo "</p>";
    [/php]
    end

    and I receive :
    begin

    Parse error: syntax error, unexpected '&' in /homez.792/mrfosses/www/mr-fosses-1-dev/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(373) : eval()'d code on line 2
    end

    What i-I must to do ?
    Many thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.