Forums

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

Home Forums Back End WordPress post loops for one category

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25235
    Squintz
    Member

    I want to add a tutorials section to my existing site. http://www.harfordhackerspace.org

    I started off by creating a new page but I don’t think that’s what I want. I really don’t know what I need which is why I am asking you guys.

    I would like to create post which contain my tutoials and have a link to a ‘page’ (if that’s the correct term) that displays only those post in a certain category. I know that get_post(category=3) will do what I need but I don’t know where to put that code so that I can add a link in my menu for the ‘page’.

    I hope I did not confuse you with my rambling so far. My thoughts are that I need to edit my theme file and do an IF check for the Tutorials page name. Then create the tutorial page as a wordpress page. Inside the IF statement I then run the get_post template tag.

    Can someone tell me if I am on the right path? Should I be editing the page php template file or is there another method to handling something like this?

    #59543
    TheDoc
    Member

    The gist of what you’re doing:

    1. In your editor of choice, create a new template that only displays posts from the "tutorial" category. You can probably take the loop that’s on your index page and modify it to only show tutorial posts, probably the easiest way.

    2. In WP, Create a page called "Tutorials", select your template made in step 1

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