• I m trying to create a template for one of the pages in my blog to retreive and display only posts belonging to a certain category.

    Where exactly (which file) should I look at to change the code retreiving the posts from the database (I simply want to add a parameter if post_ID == smth ) or smth similiar….but being new to this I still don’t know which file does the task.

    Thanks

Viewing 1 replies (of 1 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Why would you want to do this? It’s already built in.

    http://example.com/blog/category/yourcategory will do it if you have “pretty” permalinks turned on.

    http://example.com/blog/?cat=ID will do it if you have default permalinks (replace ID with the ID number of the category).

    If you want to style category archive pages differently, then you simply need to create the correct pages in the theme. category-ID.php for specific category pages, or category.php for any category archive page.

Viewing 1 replies (of 1 total)
  • The topic ‘retreive certain post categoriy ONLY from DB’ is closed to new replies.