WordPress.org

Ready to get started?Download WordPress

Forums

Allow PHP in Posts and Pages
Broken HTML output (2 posts)

  1. Crafty Coding
    Member
    Posted 1 year ago #

    I'm trying to simply output a link in the middle of a post. The echoed text is displaying before everything else in the post and as a result is in the wrong place.

    The code I'm trying to output is:

    [php]
    echo "Hello World";
    [/php]

    And it shows before the divs that I have put it in.

    When I swap out the Hello World for my actual goal and I visit the actual page I get:

    Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_ENCAPSED_AND_WHITESPACE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in /home/roteva/public_html/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(373) : eval()'d code on line 2
    
    The link I'm building is:
    
    [php]
    "<a>loggedin_user->userdata->user_login . "/profile/edit/' class='profilelink'>Päivitä profiilisi</a> ja saat 100xp!";
    [/php]

    I've tried escaping, [php mode=old] and a heap of other things to no avail. Anyone had a similar problem?

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

  2. gjcoevert
    Member
    Posted 9 months ago #

    I had the same problem. As it seems, the plugin doens't handle nested in-tag php code properly. If you replace the tag "[" by the code of a specail character, this would solve your problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic