How to display only one post on homepage ?

Discussion in 'WordPress' started by Rajnish357, Dec 8, 2011.

  1. #1
    I want to display only 1 post of my choice on Homepage nothing else.

    Please give the complete code to achieve this..

    Thanks in Adv.
     
    Rajnish357, Dec 8, 2011 IP
  2. lamvt

    lamvt Active Member

    Messages:
    153
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #2
    depending on your theme
    you can easy to edite home-page.php at local like that: http://tinbaohiem.com/wp-content/themes/vinaora/home-page.php and add code to display latest post from databse or your code here.
     
    lamvt, Dec 8, 2011 IP
  3. mhovingh

    mhovingh Well-Known Member

    Messages:
    341
    Likes Received:
    13
    Best Answers:
    1
    Trophy Points:
    145
    #3
    Use the information on this page with one of the methods below: http://codex.wordpress.org/Function_Reference/query_posts#Retrieve_a_Particular_Post

    Method 1

    Directly edit the code for the home page in your theme.

    Method 2

    Create a page and title it whatever you want (Home Page for example) and set it to display as the front page of your blog in the WP settings.

    Get a plugin that will let you execute PHP within a page/post. Insert the php you want in the page you made.
     
    mhovingh, Dec 8, 2011 IP
  4. psharma

    psharma Prominent Member

    Messages:
    1,955
    Likes Received:
    85
    Best Answers:
    4
    Trophy Points:
    345
    #4
    Go to your wordpress Dashboard > Settings > Reading > Select a static Page.
    and you are done!

    But If you want to remove the navigation bar and sidebar too, either use a landing page theme for wordpress, or just edit these things out of your current theme.
     
    psharma, Dec 8, 2011 IP
  5. yank whalley

    yank whalley Peon

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Admin Login->Dashboard -> Settings -> Reading -> Set Show only one post or Set a static Page.
     
    yank whalley, Dec 9, 2011 IP
  6. vijaymee05

    vijaymee05 Member

    Messages:
    24
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #6
    Hi i can do it for you. reply me you got its solution or not.
     
    vijaymee05, Dec 9, 2011 IP
  7. drkunalup

    drkunalup Peon

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It actually depends on a lot of parameters.
    Do you want to show the same post always or the latest post? If just the latest post, edit it here:- Dashboard -> Settings -> Reading
    If random post to be shown, you need to tweak your themes files.
    again if just a static page, then you can edit it in Dashboard -> Settings -> Reading

    Which theme are you using?
     
    drkunalup, Dec 10, 2011 IP
  8. hakimbajol

    hakimbajol Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    use plugin widget context, or set sticky to ur post
     
    hakimbajol, Dec 22, 2011 IP
  9. GameSlim

    GameSlim Peon

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You can just easily go to the settings area, then reading, then set your frontpage to display only 1 post. That should be easy.
     
    GameSlim, Dec 22, 2011 IP