• Resolved makta112

    (@makta112)


    Hello,

    I want to place a php echo inside a php tag. Look below:

    I want to add this line of code inside the php tag below it:

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

    <?php
    if ( is_user_logged_in() ) {
        echo '(<strong><em><code>HERE</code></em></strong>)';
    }
    ?>

    How can I make that work? I don’t know if it’s even possible!

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • use php string concatenation;
    example:

    <?php
    if ( is_user_logged_in() ) {
        echo '<a href="' . wp_logout_url( get_bloginfo('url') ) . '">Logout</a>';
    }
    ?>

    or rewrite the code without using ‘echo’;
    example:

    <?php
    if ( is_user_logged_in() ) { ?>
    <a href="<?php echo wp_logout_url( get_bloginfo('url') ); ?>">Logout</a>
    <?php }
    ?>
    Thread Starter makta112

    (@makta112)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php tag inside php tag’ is closed to new replies.