WordPress.org

Ready to get started?Download WordPress

Forums

Link only on home page (6 posts)

  1. ksgboy
    Member
    Posted 7 years ago #

    Hi

    Is there achance to put link to other site just on home page.

    I can't put a link in header, footer, sidebar or index template because link will show on all pages. What should i do?

    Thanks for any help

    Regards

  2. moshu
    Member
    Posted 7 years ago #

    Use a conditional - is_home
    More: http://codex.wordpress.org/Conditional_Tags

  3. ksgboy
    Member
    Posted 7 years ago #

    Thanks for help but i don't know how to use it.

    This code should look like:

    <?php if ( is_home() ) : ?>
    <p>Bottom - jkfghjkdljdfmv</p>
    <?php endif; ?>

    When i use this above I have link on each page

    CAn anyone show me how this code should look like

    Thanks in advice

    Regards

  4. ksgboy
    Member
    Posted 7 years ago #

    Any help?

  5. ksgboy
    Member
    Posted 7 years ago #

    please help me with that code above

    This code should look like:

    <?php if ( is_home() ) : ?>
    <p>Bottom - jkfghjkdljdfmv</p>
    <?php endif; ?>

    When i use this above I have link on each page

    CAn anyone show me how this code should look like

    Thanks in advice

    Regards

  6. Ashram
    Member
    Posted 7 years ago #

    You need some understanding of PHP code to incorporate this into your page. ie. learn the PHP programming language if you want to know how this all works.

    However...

    You need to edit your index.php file (or one of the other theme files depending where you want this link to be displayed) to include the following code:


    if (is_home())
    {
    echo '<insert you link here>';
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.