Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • These warnings still exist in the current version.

    I’m getting the same array_count_values() error, revisions disabled.

    what’s the fix?

    yeah, it’s not easy. the root of it is that tags and categories are in the same table in the database.

    this query will give you posts with both a specific category and tag slug. i use the slug as that’s what works for me, but you could change that to match on the name column…

    global $wpdb;
    $yourCategory = 'whatever';
    $yourTag = 'whatever';
    $querystr =	"
    			SELECT p.* from $wpdb->posts p, $wpdb->terms t, $wpdb->term_taxonomy tt, $wpdb->term_relationships tr, $wpdb->terms t2, $wpdb->term_taxonomy tt2, $wpdb->term_relationships tr2
    			WHERE = tr.object_id
    			AND t.term_id = tt.term_id
    			AND tr.term_taxonomy_id = tt.term_taxonomy_id
    			AND = tr2.object_id
    			AND t2.term_id = tt2.term_id
    			AND tr2.term_taxonomy_id = tt2.term_taxonomy_id
    			AND (tt.taxonomy = 'category' AND tt.term_id = t.term_id AND t.slug = '$yourCategory')
    			AND (tt2.taxonomy = 'post_tag' AND tt2.term_id = t2.term_id AND t2.slug = '$yourTag')
    $pageposts = $wpdb->get_results($querystr, OBJECT);
    if ($pageposts):
    	foreach ($pageposts as $post):
    		// do regular WordPress Loop stuff in here
    else :
    	// nothing found

    i’m trying to solve this myself. as a quick hack i added a bit of javascript to prevent submitting the form if the email field is blank.

Viewing 4 replies - 1 through 4 (of 4 total)