WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Put TWO lines of PHP into ONE - quotes a problem ? (4 posts)

  1. valuser
    Member
    Posted 2 years ago #

    Would like to put the following on one line !

    <?php
    $lnk = get_user_meta( 85, 'thenetwork', true ) . get_user_meta( 85, 'nickname', true ).'/';
    echo "<a href = '$lnk'>Go To</a>";
    ?>

    The above produces a link - as expected

    But when I try

    <?php
    echo "<a href = 'get_user_meta( 85, 'thenetwork', true ) . get_user_meta( 85, 'nickname', true ).'/';'>Go To</a>";?>

    the link it produces is not correct or properly formed ---->my domain.com /the name of the page/get_user_meta( 85,

    Help to get this on one line much appreciated.

    Thanks!

  2. keesiemeijer
    moderator
    Posted 2 years ago #

    try it with [untested]:

    <?php
    echo '<a href="' . get_user_meta( 85, 'thenetwork', true ) . get_user_meta( 85, 'nickname', true ) . '/">Go To</a>';
    ?>
  3. valuser
    Member
    Posted 2 years ago #

    tested. bingo! many thanks

  4. keesiemeijer
    moderator
    Posted 2 years ago #

    No problem :-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags