The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

About php code (3 posts)

  1. shojpngo
    Posted 3 years ago #

    This code run correctly.
     <?php echo '<a href="http://google.com">success</a>'; ?>

    This code run incorrectly.
     <?php echo '<a href="<?php bloginfo('url'); ?>">failure</a>'; ?>

    How should I fix this second code?

  2. catacaustic
    very awesome
    Posted 3 years ago #

    The second one doesn't work because you don't use <?php .. ?> tags inside other PHP tags. Remove those and it will work:

    <?php echo '<a href="'.bloginfo('url').'">failure</a>'; ?>

  3. Michael
    Forum Moderator
    Posted 3 years ago #


    <?php echo '<a href="' . get_bloginfo('url') . '">failure</a>'; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.