The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
35 views

Get attached media only

I am using wp_query to get uploaded medias. Everything is working fine, but wp_query will return the medias with no post attached. This is not what I wanted. How can I exclude the unattached media ...
0
votes
1answer
21 views

Exclude categories by ID

I've searched this site and tried all kinds of ways to exclude categories 1 and 7 from this list, but nothing is working. No errors but doesn't hide the cats either. Categories 1 and 7 are not empty, ...
0
votes
1answer
20 views

Don't execute function on specific posts

function content_strip_img($content) { global $post; if ($post->ID !== 1 || $post->ID !== 2 || $post->ID !== 3 ) { return preg_replace('/<img[^>]+./','', $content); } } ...
0
votes
4answers
74 views

How to exclude categories from recent posts, recent comments & category widgets?

I use the bellow function (thanks to @helgatheviking!) to exclude categories from the wordpress loop. It works very well - posts of selected categories are excluded from the loop on the main blog ...
-1
votes
1answer
16 views

Excluding cateory not working on my site. how to solve this? [closed]

I am using my own wordpress theme. I am trying to exclude some categories on my author.php I am using the following code for that purpose. $paged = (get_query_var('paged')) ? ...
8
votes
2answers
152 views

How do I exclude plugins from getting automatically updated?

There is an opt-in filter that allows all plugins on my site to receive automatic updates: add_filter( 'auto_update_plugin', '__return_true' ); I like this feature, but I don't want all my plugins ...
1
vote
1answer
80 views

exclude post from displaying in loop if it is in a category, but not in many categories

I am searching how to exclude posts from displaying in a loop if them are in a category x, but not in many categories... The Problem: if I do exclude posts i.e. out of category 5, all posts are listed ...
0
votes
1answer
49 views

How to display elements of different post types?

What happens is: I have a custom post type called "placas" and have an associated custom taxonomy called "firmas" and this taxonomy is the terms "LG", "AOC", "Panavox". I want to show a certain ...
0
votes
1answer
32 views

specific post is not excluded from the loop

I have registered a CPT and created archive-myCPT.php, here I want to exclude a specific post from the main loop. This is my code: <?php $query = new WP_Query( array( 'post_type' => ...
0
votes
1answer
68 views

exclude custom taxonomy term posts from custom post loop

I have a custom post type set up called 'projects' with a custom taxonomy called 'categories' that has a number of terms. For one of them called 'archive' i would like to remove its associated posts ...
0
votes
1answer
35 views

remove term from custom taxonomy list

I have the terms of a custom taxonomy presented in a list like this: <?php $taxonomy = 'categories'; $tax_terms = get_terms($taxonomy); ?> <ul> <?php foreach ...
0
votes
1answer
36 views

link to a random custom post while excluding current post

I am using the below code to create a link from a custom post to another random custom post. <?php $args=array('post_type'=>'projects', 'orderby'=>'rand', 'posts_per_page'=>'1'); ...
0
votes
0answers
24 views

How to exclude a taxonomy term using url alone

This may have been answered somewhere but I may not be searching for the right wording or my concept is just way off :-) In a nutshell: If I have a url like this: ...
0
votes
2answers
20 views

Exclude recently updated post from custom WP_Query using multiple loops

I want to do something like this but can't manage to figure it out. [Click][1] I am using this custom WP_Query to display upcoming events on my homepage. $events_args = array( ...
0
votes
0answers
81 views

Exclude Categories from wp_list_categories()

in before: I already searched for this answer her but couldn't find a thing that worked for me. I have a Lot of Categories and Child Categories. I use them to give a Location, Country, Type of ...
1
vote
2answers
33 views

Exclude the first 'n' number of posts of a tag from home page?

Use case (example): Using a separate, custom query my website's home page shows 5 featured posts, tagged 'Highlights (highlights)', followed by the latest posts, from the main query. I don't want the ...
0
votes
1answer
31 views

How to query posts to include specific pages of one post type, and all pages of another post type?

I'm having trouble figuring out how to query all posts from the post type "events", as well as including four specific pages in the loop. If I use the "include" parameter, it only returns the ...
0
votes
1answer
160 views

WooCommerce Hiding A Certain Category From Being Displayed On Single Product

If I go to wp-content/themes/theme-name/woocommerce/single-product/meta.php then I see this code:- <?php /** * Single Product Meta * * @author WooThemes * @package ...
0
votes
1answer
48 views

How do I exclude posts by custom field value?

I need to exclude posts that have a custom field 'city' value of 'Melbourne'. After much searching I think the solution might consist of 2 parts. In functions.php : A function to get the post IDs ...
0
votes
0answers
23 views

Exlude tag (but not whole post) from related posts list

I display related posts under each post, depending on tags. The problem is, I use tag 'featured' for my top featured slider. So 'featured' tag is the most popular tag on my website. And here is the ...
0
votes
1answer
65 views

Terms from current post custom taxonomy — excluding parent and only from a single parent term

The title sounds complex but this is quite simple. Hopefully the code for it is too. I have this custom taxonomy we'll call "Filters". ParentTerm A ChildTerm 1A ChildTerm 2A Parent Term B Child ...
0
votes
1answer
59 views

Exclude taxonomy term from all loops, but having it on widget

I have excluded a custom post type taxonomy term from all posts like this: add_action( 'pre_get_posts', 'exclude_category_posts' ); function exclude_category_posts( $the_query ) { $taxquery = ...
0
votes
1answer
631 views

exclude custom post type by meta key in wp_query

I'm trying to display a custom post type (properties) and exclude posts that have a certain meta value (sold). Is there a way that I can do this? I have this for my code so far: ...
1
vote
1answer
232 views

Exclude featured image from attachment loop

For my jigoshop theme I'm able to retrieve the images attached to my product post. However it pulls all images from both the featured image and my metabox images. What I'm trying to do is make it so ...
-1
votes
1answer
65 views

exclude page element from specific pages

I'm using a specific navigation menu that should be present on all but two pages. How can I exclude <div class="portfolio-nav"> from the specified pages(About & Contact)? <?php ...
0
votes
1answer
79 views

List post wit the same category but exclude parent

I have the followind code: <?php global $post; $cat_ID=array(); $categories = get_the_category(); //get all categories for this post foreach($categories as ...
0
votes
3answers
177 views

2 wordpress loops showing 1 post from same post type - how to avoid showing the same post?

I got to two loops in my template files. Both querying the same thing essentially. This loop in my header: $testimonial_head = new WP_Query(array( 'posts_per_page' => 1, 'post_type' ...
0
votes
1answer
152 views

Exclude posts with specific meta_value while sorting by a separate meta_value

I am trying to exclude posts with a specific meta_value with a specific meta_key while also sorting the posts by a meta_value with a different meta_key. This is my current code for the WP_Query ...
0
votes
1answer
157 views

How to exclude Sticky from Recent Post?

Im sorry about my english. I using below code to display recent post in my footer. The problem is, my recent post show sticky post. How to hide or remove sticky post from recent post?? <div ...
0
votes
1answer
152 views

Exclude all sticky posts front page twenty twelve

I am attempting to exclude all sticky posts from my front page in twenty twelve theme. I have attempted the following. I am making all changes to the child theme. To remove the following code from ...
0
votes
1answer
362 views

Exclude a 'portfolio' custom category?

I have a custom post type called 'portcat' and I want to exclude one portcat category ('weather' - ID='5') from the page. I've tried 'category__not_in' => array( 5 ) but apparently this doesn't work ...
0
votes
1answer
152 views

pre_get_posts : 'post__not_in' doesn't work with global variable

I'm trying to set a post__not_in which use a global $popular variable, defined in the index.php. -index.php- $popular[] = 1 //post id=1 $popular[] = 2 //post id=2 $popular[] = 3 //post id=3 ...
1
vote
1answer
364 views

How do I exclude the current post from listing in recent posts

I list my two most recent posts from a widget on the sidebar. When I'm viewing one of these posts from single.php, I want that post to be excluded from the list and instead show the next post in ...
0
votes
1answer
87 views

Paginate wp_query while utilizing post__not_in

I'm currently running a wp_query like this: <?php $the_query = new WP_Query( array( 'post_type' => 'photos', 'posts_per_page' => '2', ...
0
votes
1answer
533 views

Display 1 category only with get_the_category (by ID or slug)

After hours of unfruitful Googling, I am asking for your help on this issue. My objective is to display only 1 category with get_the_category if the category ID matches the ID or slug set in the ...
0
votes
3answers
241 views

using pre_get_posts to exclude

I am trying to use pre_get_posts to exclude categories from posting to the homepage. If I do it like so it works just fine $query->set( 'cat', '-13,-7,-19,-12,-24,-21,-14'); that is hard coded ...
-1
votes
1answer
292 views

Get first category only and excluding one

How can I get the first category (linked to the category archive page) of a post excluding the category called 'featured'? I found various solutions but I can't combine them properly. Thanks UPDATE: ...
0
votes
2answers
689 views

How do I remove a category from a wordpress loop>

I have a question. I need to have, in my archive.php file, a exclusion of a specific category. given what I have now, how would I make that happen? Here is the code: <?php ...
0
votes
1answer
98 views

Homepage custom recent news

Is there anyway of telling wordpress, by some plugin or whatever, not to show Recent news from Category X, on my home page? Or I may do it only by modifying the home.php code?
0
votes
1answer
267 views

Using WP_Query and Query_post for the loop?

I am using the code below to call post from a certain Taxonomy term. My intentions are to mix that into the normal loop. I'm am not trying to create two different loops, but one loop that displays ...
1
vote
2answers
246 views

Query Posts Exclude Entire Category

I am using the standard wordpress loop that looks like: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h2><?php the_title(); ?></h2> ...
0
votes
1answer
101 views

Exclude Authors based off date of last post

I have several writers that range from frequent to one-time writers for my blog. On my Author page, I would like to separate out writers that have not posted an article in 6 months. It would be nice ...
2
votes
1answer
230 views

Exclude post_type from admin comments_list

I'm trying not to show comments from a certain custom post type int the comments list on the admin interface. I went to the "wp-admin/includes/class-wp-comments-list-table.php" and tried to play with ...
0
votes
1answer
201 views

Exclude posts by post meta value

I have constructed this query to sort posts on the home page by a set position number in a custom field. However, I need to be able to exclude posts with the position set to '0'. Below is the code ...
3
votes
1answer
286 views

Retrieving custom taxonomy in order, but excluding specific tax IDs

I have a function set up and working based off the discussion in this thread: Custom taxonomy, get_the_terms, listing in order of parent > child. My version includes term links and allows me to ...
0
votes
1answer
185 views

Exclude Author by ID

How can I exclude authors by ID from this: <?php //displays all users with their avatar and their posts (titles) $blogusers = get_users_of_blog(); if ($blogusers) { foreach ($blogusers as ...
0
votes
2answers
45 views

problems exluding categories

I have done this before but for some reason, it is not working and I can't figure out why. All I am trying to do is exclude some categories from the blog page. I thought this would be a simple matter. ...
-1
votes
1answer
86 views

WP Query Obj: Set value to be unequal | Hide media by admin

I would like to hide all media uploaded by the admin. I've found an answer to this question to be pretty close. Except that the query returns all media uploaded by a specific (current) user, instead ...
0
votes
1answer
37 views

trouble with my loop

I am trying to exclude categories from my blog page. I have the code all set up and according to the codex, this should work $string = '-' . implode( ',-', explode( ' ', $data['exclude_categories'] ...
0
votes
3answers
3k views

Exclude post ID from wp_query

How can I exclude one specific post from a WP_Query query? (For example, show all posts apart from a post with the ID 278) I've tried the post__not_in argument but it just removes all posts.. Any ...