Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [Solved] WordPress – Output Posts from Specific Category

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26631
    andrews
    Participant

    Gday, I am trying to get wordpress to only output posts from a certain category on the front page of my new website. Does anyone know how to adjust the below code to achieve this?

    Code:

    Many thanks.

    #66131
    Rob MacKay
    Participant

    Yup – its all in here :)

    http://codex.wordpress.org/The_Loop

    :D

    #66137
    TheDoc
    Member

    More specifically, you’re looking for the query_posts function:

    http://codex.wordpress.org/Template_Tags/query_posts

    #66221
    andrews
    Participant

    Thank you….but unfortunately my php skills are a little scarce.

    Currently the code on my wordpress index.php is –

    Code:

    And from the wordpress Codex I have established that I need to implement:

    Code:
    query_posts(‘cat=1’);

    However I’m clueless as to how to include this into my existing code… :?:

    Any further help would be appreciated :)

    #66238
    Chris Coyier
    Keymaster

    Just change the line that opens up the loop to this:

    Code:
    #66251
    andrews
    Participant

    Fantastic! Thank you Chris :)

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.