• eniu

    (@eniu)


    Hey there

    I’m new to wordpress and i have some troubles excluding the gallery post format. I search for a solution but didn’t found anything. I may search for the wrong keywords. Here my problem:

    I want to exclude all posts with the post format gallery from home, archive and categories. If I exclude the posts in the archive.php with the following code, the galleries won’t be displayed if i access the page with ?post_format=gallery.

    $args = array(
    	'tax_query' => array(
    		array(
    			'taxonomy' => 'post_format',
    			'field'    => 'slug',
    			'operator' => 'NOT IN',
    			'terms'    => 'post-format-gallery'
    		)
    	)
    );
    global $wp_query;
    query_posts(array_merge($wp_query->query, $args));

    How is it possible to exclude a post format from the archive but show them when accessing the page with ??post_format=gallery?

    Best wishes
    eniu

  • The topic ‘Excluding post format problems’ is closed to new replies.