The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
20 views

Use posts_where to exclude posts ids from wp_query

I want to use posts_where to exclude an array of posts ids from all queries in my site. The array containing the posts ids depends on the user that is logged in. Can someone please tell me how to ...
0
votes
2answers
299 views

Conditionally exclude post from specific category on home page sidebar?

I want to exclude posts from one category. These posts should not show in the sidebar on the homepage only when I explicitly don't want that particular posts to show. In all other cases these posts ...
0
votes
2answers
3k views

Exclude current post ID from loop in sidepbar.php

Currently all the below bit of code is doing is showing 3 random posts from the same category that the current page resides in. So if the current page falls in the artists category, for example, show ...
0
votes
0answers
23 views

Function to bypass specific words in search?

Is it possible for a word to be skipped/excluded/ignored in the default search? For example if I could make it so that if I type the great thing in the url instead of '?s=the+great+thing' it will ...
0
votes
1answer
38 views

Loop doesn't exclude the specified category in home page

Oh, hello! I want to show the three most recent blog posts in the home page, excluding the "featured" category, which has the ID 8. In order to see the ID for that category, I went to Posts > Category ...
0
votes
0answers
36 views

How to exclude sidebar from pages?

I put some page id's in exclude page in appearance -> widget -> pages -> left sidebar. But these pages still exist in sidebar which is not to. Site: http://goo.gl/ek63ye Here's the code of left ...
12
votes
2answers
558 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
3answers
5k 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 ...
0
votes
1answer
36 views

How to exclude one post format from search result?

I need to exclude one post format from Wordpress search results. Any suggestions on how to solve this issue?
0
votes
1answer
63 views

How to exclude posts from category posts count

I have a custom loop to display posts based on a custom field. My problem is that if i have 2 posts and exclude 1 from the loop the category posts count (categories list widget with show count enable) ...
3
votes
1answer
1k views

Exclude Specific Term from Search

It is possible to search for posts with a specific term by appending the URL with: ?&term=abc Is it possible to do the opposite and search excluding a specific term? Something like: ...
0
votes
1answer
94 views

Exclude category from foreach loop

How can I exclude one category from this loop wher I list my custom type projects by year ? <?php foreach(posts_by_year() as $year => $posts) : ?> <h3><?php echo $year; ...
1
vote
4answers
4k views

Exclude the category from the WordPress loop

I have this code for the loop, and I need to exclude a category 4 from this loop. Any suggestions on how to achieve this? Code that starts the loop <?php if(have_posts()): ?> <ol ...
-1
votes
2answers
72 views

Query: offset post list, unless it's a specific category

Here's my code: <?php query_posts(array ('showposts' => '1', 'cat' => '-11')); if (have_posts()) : while (have_posts()) : the_post(); get_template_part( 'content', 'archives' ); ...
0
votes
1answer
31 views

Include Category With Tax Query

I'm using The Events Calendar plugin but I thought I'd post it here as I believe this particular function works the same as get_posts(). I'm trying to use the function to display only posts from one ...
1
vote
0answers
471 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 from ...
0
votes
1answer
96 views

Exclude all subcategories in the_category (post)

I'm looking for a way to hide all the subcategories based in my post: It always displays in my posts like : Categorie, sub categories. So I'd like to exclude all of the sub_categories. I've been ...
0
votes
0answers
33 views

Exclude one specific slug from rewrite rule

I use the following rewrite rules to show a specific post of a custom post type in a category and all posts of a custom post type within a category: add_filter('rewrite_rules_array', ...
2
votes
1answer
37 views

Default WP search excluding specific characters, is it possible?

I would like to know if it possible to customize the default search module of Wordpress. I've a website dealing with teams and teams' news. Some of those teams has their names written like this ...
0
votes
1answer
62 views

Have posts that belong to multiple categories, exclude some categories from homepage

So I have categories A, B, C and D. And also categories 1, 2, 3 and 4. I have posts that can belong to any four of these categories. But I want to exclude anything in categories B, 4 and D from the ...
1
vote
2answers
228 views

Exclude Posts From Specific Category from Next and Previous post links

I've been searching for this a lot...but all I get is not what I need. I simply want to show next and previous links on single.php (from all the categories, based on publish date, not just in the ...
0
votes
2answers
49 views

Exclude some categories from the post page

I have created a page called "videos", this is set as the post page where all post should show up. That´s fine, but I want to exclude all posts from two of the sites categories. I tried this code, ...
0
votes
1answer
23 views

widget exclude post by custom field

I have a widget that gets posts from different post_type's. I want to exclude some posts that have a custom field value e.g. I save a form where a checkbox adds a value of 0 or 1 depending if ticked. ...
0
votes
1answer
995 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
1answer
118 views

Category menu that filters out empty categories

I'm trying to build a menu which can be administered from the menu editor, but gets filtered before being output. More specifically the menu contains Woocommerce product categories, organised into a ...
0
votes
1answer
132 views

Weird string offset errors when displaying post attachments

I'm trying to create a gallery page that takes image attachments from a certain category and displays them. It works but I have a problem it seems where I'm trying to exclude certain attachment types ...
4
votes
1answer
961 views

Exclude categories from Loop, queries, widgets, post navigation

I recently ha a use case where I needed to prevent a certain category from being displayed in the front-end. In detail I needed to exclude posts assigned to that category from the main query (“the ...
0
votes
1answer
109 views

Exclude category from get_the_category

I want to exclude a specific category from the loop, here's what I tried: Original code: // auto posts by cat if( $bawmrp_options['auto_posts'] == 'cat' || $bawmrp_options['auto_posts'] == ...
3
votes
1answer
149 views

Excludes posts that don't have attachments in the_content()

I'm trying to write a loop that excludes posts that don't have attachments in their content areas. I've got 200 posts in a custom post type called "students". I need to do a query of all students ...
0
votes
1answer
124 views

I need to exclude from a query a category and a few custom taxonomies

I need to exclude from a query a category and a few custom taxonomies. Is this code right? This query don't exclude any post, the one with the category, or the custom taxonomy. What am I doing wrong? ...
0
votes
2answers
284 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
112 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
24 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
678 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
vote
4answers
3k views

is there a quick way to hide category from everywhere?

I want to get rid of some posts, old ones, that I don't really want to keep. I was thinking to create a category named 'old' and use it as a garbage can to trash everything I don't like from old ...
0
votes
3answers
1k views

How to exclude/filter a tag from get_the_tag_list()

Does anyone know how to exclude/filter a tag from the HTML string generated by get_the_tag_list()? http://codex.wordpress.org/Function_Reference/get_the_tag_list Any help much appreciated.
-1
votes
1answer
24 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')) ? ...
1
vote
1answer
165 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
100 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
49 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
99 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
71 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
40 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
44 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
152 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
1answer
86 views

Exclude category from fucntion

QUESTION Hey guys, I have this function and I need to exclude 2 categories: 81 and 82. Can You help? :) CODE function has_related_same_cat_posts(){ global $post; $categories = ...
1
vote
2answers
71 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 ...
2
votes
3answers
590 views

Exclude ALL posts from sub categories

Need help with a wordpress-task I want ALL the posts from sub categories to be excluded. Example: Cake Pie Apple Pear Banana If i post a post in Banana, i don't want it to show up in Pie or ...
0
votes
1answer
51 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
436 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 ...