Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 1685

Every Post in WordPress is filed under one or more Categories. Categories allow the classification of your Posts into groups and subgroups, thereby aiding viewers in the navigation and use of your site.

0
votes
You want the function in_category(), not in_cat(). And to check multiple categories you need to pass an array as a single argument (as opposed to multiple arguments): if ( is_single() && in_category( array( 3, 5, 6 ) ) ) …
answered Apr 2 '14 by TheDeadMedic
2
votes
I would suggest a cleaner approach would be to implement an exclude_slugs argument for the function, then you can just use the following in your template code: wp_list_categories([ 'exclude_slugs …
answered Feb 16 '16 by TheDeadMedic
1
vote
Just use the selected argument: wp_dropdown_categories( array( 'show_option_all' => 'All Deployments', 'hierarchical' => true, 'show_count' => true, 'selected' => get_query_var( 'cat' …
answered Nov 8 '12 by TheDeadMedic
1
vote
also mean you can approve new categories they've added before they appear on the site (by default, only categories that have published posts will appear). …
answered Jun 18 '11 by TheDeadMedic
4
votes
file(s), or filtering out categories on the front-end (ask if you need help on that). For example, in your theme's index.php and single.php, you might have something like; filed under: <?php the_category( ', ' ); ?>. Just remove it and you're done! …
answered Mar 15 '11 by TheDeadMedic
0
votes
Instead of: $categories = get_the_category(); $categories_id = $categories[0]->cat_ID; ...use: $categories = wp_list_pluck( get_the_category(), 'term_id' ); Now you can correctly use … in_array to search all the post's categories, rather than just the first: if ( in_array( $thisTrueCat->term_id, $categories ) ) { ... } …
answered May 7 '14 by TheDeadMedic
0
votes
Essentially, you need: A global role-category relationship list, and/or... A per-user category list For per-user categories, hook onto the relevant profile actions: show_user_profile … categories like so: if ( $user = wp_get_current_user() ) { $terms = array(); if ( is_array( $role_terms = get_option( 'product_cat_roles' ) ) ) { foreach ( $user->roles as $role …
answered Jun 9 '14 by TheDeadMedic
3
votes
It's down to how you're using get_term_link() - since you're passing a slug, WordPress can't locate the term in it's internal cache (terms are indexed by ID), so it grabs it directly from the db. To …
answered Oct 7 '15 by TheDeadMedic
1
vote
You can use wp_list_pages with the child_of argument: /** * Display hierarchical list of all posts for a given post. * * @param int|WP_Post $post Display for post. Defaults to current post/pa …
answered Apr 17 '15 by TheDeadMedic
0
votes
why not use wp_list_categories? wp_list_categories( 'show_count=1' );
answered Jun 30 '11 by TheDeadMedic
0
votes
Long story short, build a new array with the categories indexed by ID. Then you can just loop over the date-sorted IDs and do with them as you wish: $categories = get_categories(); $cats_index … = $cats_dates = array(); foreach( $categories as $category ) { // Index the categories by their ID $cats_index[ $category->term_id ] = $category; $posts = get_posts( array …
answered Aug 26 '15 by TheDeadMedic
3
votes
general-purpose approach, use a function; /** * List categories for posts that have $tag. * * @param string|int|object $tag Tag slug, ID or object * @param string|array $args Args to pass to {@see …
answered Jun 18 '11 by TheDeadMedic
3
votes
You can use get_ancestors: <?php if ( $term_ids = get_ancestors( get_queried_object_id(), 'category', 'taxonomy' ) ) { $crumbs = []; foreach ( $term_ids as $term_id ) { $term = get_ …
answered May 4 '16 by TheDeadMedic
4
votes
I would recommend using the category_template filter - just check if the current category is an ancestor of 67: function wpse_179617_category_template( $template ) { if ( cat_is_ancestor_of( 67, …
answered Feb 27 '15 by TheDeadMedic
1
vote
Just skip the excluded category in your foreach: foreach ( $cat_array as $cat ) { if ( $cat != EXCLUDED_CAT_ID ) { // Output } }
answered May 9 '15 by TheDeadMedic

15 30 50 per page