• Resolved megamers

    (@megamers)


    Hi everyone,

    I’m building this site on wordpress:
    https://megamers.tbreak.com/

    I have a problem with multiple categories.

    Problem no 1: How do I select articles that are related to two categories? i.e articles that have been categorized as say, both PC and Reviews.

    I normally use a query like this:
    <?php $recent = new WP_Query(“cat=3,15&showposts=5”); while($recent->have_posts()) : $recent->the_post();?>

    But this acts as an OR. So, it would pick up articles that are PC OR Reviews. I want to pick up articles that are PC AND Reviews.

    Problem no 2: How do I separate category pages. i.e

    https://megamers.tbreak.com/format/pc should go to the PC homepage.
    https://megamers.tbreak.com/format/pc/video should go to the PC videos page.

    Problem is, if the first article is tagged as both PC and Videos and I want to go to the PC homepage, it takes me to the PC videos page instead.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple category problem’ is closed to new replies.