0

I'm hoping someone can help. I'm not a php coder, but I've been tweeking and customising a premium theme for wordpress anyway, and I'm stuck.

I'm trying to exclude a specific category from a page which lists all the categories by default. Ok, no problem. It should be:

<?php query_posts($query_string . '&cat=-134'); ?>

right?

I'm pretty sure the category number is 134, but I could be wrong. The premium theme I'm using is called Risen, and there's a lot of different kinds of posts - so maybe what I think is a category is really a tag in a custom taxonomy - in which case ???

When I hover over it in the category listing I get this:

example.com/wp-admin/edit-tags.php?action=edit&taxonomy=risen_multimedia_category&tag_ID=134&post_type=risen_multimedia

I'm pretty sure I've found where I need to include my argument, and that is here in the template:

// Get posts
$multimedia_query = new WP_Query( array(
    'post_type'         => 'risen_multimedia',
    'posts_per_page'    => risen_option( 'multimedia_per_page' ) ? risen_option(  'multimedia_per_page' ) : risen_option_default( 'multimedia_per_page' ),
    'paged'             => risen_page_num() // returns/corrects $paged so pagination works on static front page
) );

I've tried adding

'tag'   => -134

to this array to no avail.

Tunaki
  • 132,869
  • 46
  • 340
  • 423
5tratus
  • 47
  • 1
  • 2
  • 5

1 Answers1

0

Being a premium, and apperently tweaked, theme there is a lot of guessing here but I think you have talked yourself into the solution, except for one detail. Use tag__not_in not tag=-134

// Get posts
$multimedia_query = new WP_Query( array(
    'post_type'         => 'risen_multimedia',
    'posts_per_page'    => risen_option( 'multimedia_per_page' ) ? risen_option(  'multimedia_per_page' ) : risen_option_default( 'multimedia_per_page' ),
    'paged'             => risen_page_num() // returns/corrects $paged so pagination works on static front page
    'tag__not_in'       => array(134)
) );

tag_id=-134 might work (I'd have to test it) but tag expects the tag slug not an ID.

tag (string) - use tag slug
http://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters

s_ha_dum
  • 2,840
  • 2
  • 18
  • 23
  • Thank you for the suggestions @s_ha_dum . I have tried numerous variations on it, and alas => :(, nothing seems to happen. I've now also tried `'post__not_in' => array(134)` and `'post__not_in' => 134`. One of those had no effect, and the other brought up no results at all, which I suspect means it broke something. Ahh well, bed time first, then brush up on Class References tomorrow it seems. Cheers! – 5tratus Jan 07 '13 at 01:44