Altering the loop – in custom (not mine) php…
-
Okay, I think I understand how to use the loop to alter which categories show up on which separate pages. I have two categories (news and jobs) and two main pages to display excerpts of each of those, and now I need to have the article pages for each to link only to others of the same category. So a news post will only have other news posts in the <- previous and next -> links. I believe I can do that by altering each loop on separate article templates.
But — as I started to browse the php file, I realized my developer had done something beyond my understanding. The template file is here:
https://wordpress.pastebin.com/pQd0mGC5The relevant section (I believe) is between the highlights. Anyone have any ideas where I can insert something like
<?php query_posts($query_string . '&cat=-3,-8'); ?>
as shown in the codex at https://codex.www.ads-software.com/The_Loop?An last question — by
-3,-8
does that mean I need to use the category number or can I use a category name (such as-news
)?Many thanks as always!
- The topic ‘Altering the loop – in custom (not mine) php…’ is closed to new replies.