1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wordpress Help - Anyone know how to show something on the home page only?

Discussion in 'WordPress' started by jg123, Jun 10, 2008.

  1. #1
    I want to show the text below on the home page only at www.TopGamblingNews.com - any help would be greatly appreciated!

    Keep track of the latest changes in the poker world
    Keep yourself updated on the online poker world . Who are the best players, where are all the best pokerrooms for online play? Answers to this questions can be found at a site called www.pokerlistings.com, they have all the news. Check them out!


    Here is the entire page code:

     
    jg123, Jun 10, 2008 IP
  2. online business

    online business Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Look at bingness dot com - they have a product which you can use to learn about wp theme customization. The product comes with free support on theme customization for your particular theme. Your issue should be easy to do considering that the gurus at bingness have helped a lot of people with much more complex wordpress customization.
     
    online business, Jun 10, 2008 IP
  3. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #3
    Not really looking for a product, just some code to do what I need.
     
    jg123, Jun 11, 2008 IP
  4. godsofchaos

    godsofchaos Peon

    Messages:
    2,595
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #4
    godsofchaos, Jun 11, 2008 IP
  5. dct

    dct Finder of cool gadgets

    Messages:
    3,132
    Likes Received:
    328
    Best Answers:
    0
    Trophy Points:
    230
    #5
    The condition you want is something like:
    
    
    <?php 
    global $paged;
    if(is_home() && $paged == 1)
    { 
    ?>
    
    // Do home page only content here
    
    <?php
    }
    ?>
    
    
    PHP:
    You'd probably be best finding a plugin to it as that would be easier to maintain
     
    dct, Jun 11, 2008 IP
  6. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #6
    I checked Wordpress.org and did not figure it out, there was a post on the forum that was similar to what I needed but their solution did not work for me. Here is that thread if it can help anyone help me, I can also offer a free permanent featured link on one of my directories as a way of saying thanks!!!!
     
    jg123, Jun 11, 2008 IP
  7. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #7
    Did you try this on the index.php only? It worked here:

    http://dietandweightlossprograms.com/

    Look for test on the left side under the header.

    In the code I put it between

    get_header
    p>test</p
    div id=content
     
    flawebworks, Jun 11, 2008 IP
  8. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #8
    You mean did I try what they said in the post? Yes, but look at the code I am adding, maybe that is the problem? Can I use the <font> code inside that code?

    and yes I did it on the index.php file only.

    This is the error I get when adding the stuff below: Parse error: syntax error, unexpected T_ENDIF in /home/tgamble/public_html/wp-content/themes/Lonely_Lemon/index.php on line 15

     
    jg123, Jun 11, 2008 IP
  9. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #9
    I wouldn't use any other html code but your basic code, but play around with it. If you want the font tag to be special. you should add it into the css file.

    What is the post_post? Try putting the code between the header and content, and align it the way you want, like p align=center.
     
    flawebworks, Jun 11, 2008 IP
  10. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #10
    flawebworks, Jun 11, 2008 IP
    jg123 likes this.
  11. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #11
    Here's a plugin that might work to an extent, but it doesn't do exactly what you want:

    http://www.richardkmiller.com/blog/wordpress-plugin-what-would-seth-godin-do

    Alternatively, you can set one page to be the home page, and put your blurb there. You do this by going to Options/Reading, and then selecting Frontpage displays. You could create a specific page for your front page, use that blurb and any thing else you might want to use.
     
    flawebworks, Jun 11, 2008 IP
  12. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #12
    I guess the code does work I just need it tweaked to display my info, could it be the live URL's that is messing the code up?
     
    jg123, Jun 11, 2008 IP
  13. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #13
    I just added a link to mine and it worked. Look at the second to last "test."

    What version of wordpress are you using?
     
    flawebworks, Jun 11, 2008 IP
  14. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #14
    I think I am using 2.1 but the php code should work on every version?
     
    jg123, Jun 11, 2008 IP
  15. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #15
    It should. If you want to upload your template somewhere, I'll download it and install it and mess with it on my end. Send me a pm to let me know.
     
    flawebworks, Jun 11, 2008 IP
  16. jg123

    jg123 Notable Member

    Messages:
    6,006
    Likes Received:
    387
    Best Answers:
    0
    Trophy Points:
    295
    #16
    Thanks for the offer, Yiam PM'ed me the code and it worked, for curiousity sake you can take a look at it on topgamblingnews.com, I can't really tell the difference of why it worked.
     
    jg123, Jun 13, 2008 IP
  17. BANAGO

    BANAGO Active Member

    Messages:
    456
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #17
    This is the code you need.

    
    
     <?php if ( is_home()) { ?>
    
    // Here goes the content you want to show in the front page.
    
    <?php } ?>
    
    
    
    PHP:
     
    BANAGO, Jun 13, 2008 IP