• I am new here and hope somebody will help me.
    I need to place text link only in homepage of my wordpress blog and in no other place like posts, categories etc.
    I found this http://wordpress.org/support/topic/252831?replies=6 but do not understand it fully.
    Hope somebody will help and tell me stepwise how to do place link only in homepage.
    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • It is difficult to give specifics without knowing what theme you are using, or how you want the link to appear, but I will try. I assume that you want the link to appear after your header and before the text of any posts, and that you want it to be shown as h2 format.

    First, back up your index.php file as you will be editing it.

    Most themes have lines in the index.php file that call get_header(), start the content div, then start the loop. More than likely, it will look similar to this:

    get_header(); ?>
    
       <div id="content" class="narrowcolumn" role="main">
    
          <?php if (have_posts()) : ?>

    You probably want to place your link just after the line that starts the content div (although it may be called a different name in your theme).

    get_header(); ?>
    
       <div id="content" class="narrowcolumn" role="main">
          <?php
          if (is_front_page()) {
             echo "<h2><a href='http://bluegrassmiataclub.com'
                alt='link to my site'
                title='link to my site'>Link to my site</a></h2>";
          }
          ?>
          <?php if (have_posts()) : ?>

    Change the actual link, and the ‘link to my site’ text to fit your needs.

    OOPS – take out that alt=’link to my site’ line. That applies to images.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to place link in homepage only in my wordpress blog?’ is closed to new replies.