excluding posts by an ACF field in pagination
excluding posts by an ACF field in pagination
excluding posts by an ACF field in pagination
Exclude Woocommerce Product Category From Sitemap
exclude certain categories form archive widget
The only way I could figure it out was to build a list of ID’s to exclude like this: /* * Hide some pages from search results */ function SearchFilter($query) { if ($query->is_search) { $exclude=”18,20,12,22,132,76,81,78,84,91″; // Get all children of #18 $pages = get_pages(‘post_parent=18’); foreach($pages as $child) { $exclude .= “,” . $child->ID; } $query->set(‘post__not_in’, … Read more
You could go to the wordpress menu and make the target of the link a #. If the user clicks on it, they are taken to the top of the page where they probably are anyway since they’re using the navigation.
try: <?php $cat_to_EXCLUDE = 50; $cate_id = retrieve_cat_data(true); $cate_name = retrieve_cat_data(false); for ($i = 0; $i < count($cate_name); $i++ ) { ?> if ($cate_id[$i] != $cat_to_EXCLUDE){ <option value=”<?php echo $cate_id[$i]; ?>”><?php echo $cate_name[$i]; ?> </option><?php }} ?> update: if you search your theme’s functions.php file i bet you will find a function named retrieve_cat_data anyway … Read more
If the URL being “hard-coded” is the problem you can use get_category_link foreach((get_the_category()) as $cat) { if ($cat->cat_ID !=’12’) echo ‘<a href=”‘.get_category_link($cat->cat_ID).'”> | ‘ . $cat->cat_name . ‘</a>’; }
I’ve tried quite a few plug-ins to restrict user access. The best that I’ve found is the Members Plug-in by Justin Tadlock. You can download it here: http://wordpress.org/extend/plugins/members/ Source: WordPress as a CMS Membership website The plug-in allows you to restrict access to individual posts, possibly by categories, but I don’t see the setting after … Read more
There is not depth parameter for get_posts. See http://codex.wordpress.org/Template_Tags/get_posts You will need to check to see whether the page has a parent and display it if it does not have a parent. Once you are in the foreach loop add an if statement <?php if( !$post->parent ): ?> <li><a href=”https://wordpress.stackexchange.com/questions/26866/<?php the_permalink(); ?>” title=”<?php the_title(); ?>”> … Read more
You directly cannot pass the name or slug for excluding a particular category. You have to use the id. Modifying your code: <?php $category_id = get_cat_ID(‘featured’); //if get_query_var(‘paged’) doesn’t work, then try using get_query_var(‘page’) in the next line. $paged = (get_query_var(‘paged’))?get_query_var(‘paged’):1; $q = array(); $q[‘category__not_in’] = array($category_id); $q[‘paged’] = $paged; query_posts($q); if (have_posts()) : while … Read more