Help showing some text in Wordpress

Discussion in 'WordPress' started by jg123, Nov 22, 2007.

  1. #1
    On my blog www.TopGamblingNews.com I want to show a little snippet of text only at the top of the page, where it says "This poker news and information blog will be be bringing you the most current and interesting gambling news from around the world." right now, but as you can see it shows it above every single post.

    Anyone can tell me how to do this?

    thanks
     
    jg123, Nov 22, 2007 IP
  2. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's inside the loop that displays the posts. You'd have to create a div outside of it (or table cell as you're using tables) and put it in there.
     
    Crimsonc, Nov 22, 2007 IP
    jg123 likes this.
  3. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #3
    Can you or anyone else show me the code needed? I can offer a free featured listing in my directory as thanks :)
     
    jg123, Nov 22, 2007 IP
  4. blogosquare

    blogosquare Peon

    Messages:
    41
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    since you're on WP, open index.php or home.php and page.php and paste that piece of text at the top part outside the post/page loop i.e before the following code :

    <?php while ( have_posts() ) : the_post() ?>

    do tell whether it worked else I'll provide more clarification :)
     
    blogosquare, Nov 22, 2007 IP
    jg123 likes this.
  5. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #5
    So I need to change two files? I dont see page.php
     
    jg123, Nov 22, 2007 IP
  6. Houdy

    Houdy Peon

    Messages:
    267
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I think there is some confusion here as to what file to edit because of the interchangeability of the term "Page". When you use the term "Page" do you mean a separate page that you created or the main page of the blog?

    If just the main or front page of your blog then do as blogosquare said and place the text on index.php before the loop. If on a different page (not a post) then you can create a custom page template and use it for that specific page.
     
    Houdy, Nov 22, 2007 IP
    jg123 likes this.
  7. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #7
    I just want the text to show on the home page.
     
    jg123, Nov 22, 2007 IP
  8. Houdy

    Houdy Peon

    Messages:
    267
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #8
    If just the main or front page of your blog then do as blogosquare said and place the text on index.php before the loop.

    ...open index.php and paste that piece of text at the top part outside the post/page loop i.e before the following code :

    <?php while ( have_posts() ) : the_post() ?>
     
    Houdy, Nov 22, 2007 IP
  9. a-humblekid

    a-humblekid Peon

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    where do you want it to show?
    is it on the header?
    then just do this
    1. go to your template editor,
    2. open the header.php
    3. go to the last lines, type your words there.
    4. save your file. and done.

    if that is not the place.
    do this
    1. go to your index.php
    2. find this code <?php while ( have_posts() ) : the_post() ?>
    3. put your words directly before that code
    4. save your template and done.

    the step above will make it appear on the frontpage only.

    if you want it to appear on your static page (like contact me page, about us page, not the regular posts page)
    go to page.php and do the same step above.

    if you want to show it on the regular post page also
    go to single.php (single post) and do the same step above.

    if you want to show it on top of your category and arvhice list page.
    go to archive.php and do the same step above.

    hope it helps.
    thanks
     
    a-humblekid, Nov 22, 2007 IP
    jg123 likes this.
  10. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #10
    Well after all this I just moved the two sentences up one line and it worked. I don't mind it showing site-wide I just didn't want it to show above every single post.

    thanks everyone.
     
    jg123, Nov 23, 2007 IP