Wordpress help

Discussion in 'WordPress' started by SHO, Nov 2, 2011.

  1. #1
    I want to add static content to the hompage but only at the top of the page and then have the most recent posts under. Is there a plugin for this or do I need to find a template that does this?
     
    SHO, Nov 2, 2011 IP
  2. tcgreen_92

    tcgreen_92 Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    Pretty simple, in your theme folder copy "page.php" and rename it "page-home.php", open the file and add the loop code from index.php. Now in the wordpress dashboard, create a new page called "Home", put the content in as you would. Finally, go to Settings > Reading and select the page "Home" as your home page.

    I'm on my laptop right now so I can't just copy/paste the full code here for you (I have such a page-home.php on one of my themes), but if you're still having trouble I'll try to help you. :)
     
    tcgreen_92, Nov 2, 2011 IP
  3. SHO

    SHO Peon

    Messages:
    717
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I dont really understand fully
     
    SHO, Nov 2, 2011 IP
  4. tcgreen_92

    tcgreen_92 Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    OK, I will switch on my PC in a sec and write a detailed post. :)
     
    tcgreen_92, Nov 2, 2011 IP
  5. SHO

    SHO Peon

    Messages:
    717
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks i will try what you say
     
    SHO, Nov 2, 2011 IP
  6. tcgreen_92

    tcgreen_92 Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    OK...

    Firstly, in your wordpress admin dashboard, create a new Page. Title "Home". Content: The static content you want to display above the posts.

    Now open your theme directory in cpanel or whatever panel your host provides. Create a new file called "page-home.php", edit this file, and copy/paste the following code to it:
    http://pastebin.com/gBqRXkTr
    Code (markup):
    Save the file.

    In your wordpress admin dashboard, go to Settings > Reading. On the "Front page displays" setting, select "static page" as front page and choose the page we created earlier, "Home".
     
    tcgreen_92, Nov 2, 2011 IP
  7. SHO

    SHO Peon

    Messages:
    717
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    SHO, Nov 2, 2011 IP
  8. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    If your theme does not have any home.php, just add a page named "home.php" and copy your codes there. WP will automatically detect home.php as homepage.
     
    тнє Sufi, Nov 3, 2011 IP
  9. tcgreen_92

    tcgreen_92 Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #9
    I can't believe I've been using Wordpress so long and not known that. Thanks! :D

    With that in mind @SHO, create "home.php" in your theme directory and add the code I pastebinned. :p
     
    tcgreen_92, Nov 3, 2011 IP
  10. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    @tcgreen_92
    you are welcome :)

    @SHO
    In the code, you probably need to change according to your CSS. Or it won't work properly.
     
    тнє Sufi, Nov 3, 2011 IP
  11. seenotaajs

    seenotaajs Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Or you can just create a post and change the setting where it says visibility or status ( I don't remember exactly but they are right next to each other) and put that post as "sticky" . It will stay at the top as long as it's sticky.
     
    seenotaajs, Nov 3, 2011 IP