Forums

[resolved] How To Pass Tags Through IF Statements? (2 posts)

  1. Andrew
    Member
    Posted 5 months ago #

    Hello.

    I have an if is_page statement and would like to use the home_url or site_url inside of it.

    Here is the code I would like to get to work:

    <?php if ( is_page () ) {
    echo '<a href="<?php site_url(); ?>"><?php bloginfo('name'); ?></a>'
    } else {} ?>

    How can I do it?

    Please help.

    Thank you,

    Andrew

  2. Andrew
    Member
    Posted 5 months ago #

    Nevermind. I found out how to do it.

    I'll do it like this:

    <?php if ( is_page () ) ; ?>
    <a href="<?php site_url () ; ?>"><?php bloginfo ( 'name' ) ; ?></a>

    Works for me right now.

    Thank you,

    Andrew

Reply

You must log in to post.

About this Topic

Tags