text link in wp only at homepage

Discussion in 'Blogging' started by Jalpari, Jan 13, 2008.

  1. #1
    1- How i can display some advertising links in wp only at homepage? (coz i sell that advertising space not for all pages)
    2- How i can put topsites code only at index page?
     
    Jalpari, Jan 13, 2008 IP
  2. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #2
    I think you can either use the <?php /* If this is the front page */ if (is_home()) {?>
    command in the index.php file or the sidebar.php file, or put it in the <!-- first post --> section before
    <?php $top_query = new WP_Query('showposts=1'); ?> in the index.php file.
     
    qazu, Jan 13, 2008 IP
  3. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #3

    But by making changes in sidebar or index file those changes appears for all blog?
     
    Jalpari, Jan 13, 2008 IP
  4. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Create a home.php and put whatever links you want in it.
     
    mizaks, Jan 13, 2008 IP
  5. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #5
    and how i will display home.php file/page at my index page? (Which other file do i need to edit)
     
    Jalpari, Jan 14, 2008 IP
  6. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #6
    The if (is_home) command will only execute if it is the homepage regardless if the if (is_home) is in the index.php or sidebar.php file.
     
    qazu, Jan 15, 2008 IP
  7. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #7
    sorry i can't understand can u elaborate ur quote bit more!
     
    Jalpari, Jan 17, 2008 IP
  8. hanushh

    hanushh Peon

    Messages:
    198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    hanushh, Jan 17, 2008 IP
  9. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #9
    plz help me is there any plugin which i can use?
     
    Jalpari, Jan 22, 2008 IP