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 7355

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
This will add a current-cat class to any / all categories connected to the post, not jut one. Add this to functions.php function tax_cat_active( $output, $args ) { if(is_single()){ global …
answered Nov 8 '13 by Howdy_McGee
1
vote
Since you are in a Single Post you'll need to first get the categories then use get_ancestors() to display the hierarchy. $product_cats = wp_get_post_terms( get_the_ID(), 'product_cat' ); if … some error checking if there are no categories checked or if the term attached has no parents. First we get all the Post Terms and use only 1 as the basis to get all its ancestors. If it has a parent …
answered Mar 2 '15 by Howdy_McGee
0
votes
First you would need to check if the category has children, if it does then we can show a few things. Below is a helpful function to check just that. function category_has_children( $term_id = 0, $po …
answered Feb 20 '15 by Howdy_McGee
1
vote
Instead of getting all categories you could just loop through your excluded slug array and use get_term_by(): $exclude_slugs = array( 'fp-feature', 'fp-aside-feature …
answered Feb 16 '16 by Howdy_McGee
3
votes
categories you can call the function like so: category_has_children( 17 ); If you need to test a custom taxonomy it will work almost the same, you'll just need to pass in an extra parameter 'taxonomy-slug …
answered Jan 28 '15 by Howdy_McGee
9
votes
Read the PHP docs on sprintf(). %s is just a placeholder for a string %d is just a placeholder for a number So an example of sprintf would look like this: $variable = sprintf( 'The %s ran dow …
answered Feb 16 '18 by Howdy_McGee
0
votes
I personally like to take all the categories a post is attached to and slap an active class onto them. Here's the code I found and currently use. /** Active Category **/ // Single Posts only … function singlePostActiveCat ($CatText) { global $post; if (is_singular()) { $categories = wp_get_post_categories($post->ID); foreach ($categories as $category_id) { $category = get_category …
answered Apr 29 '14 by Howdy_McGee
0
votes
There's a few things wrong with your code here. Your call to the function has the parameters mixed up. $args are passed first to the function but in your function definition they are expected to be …
answered May 16 '18 by Howdy_McGee
1
vote
Here's raw code for the DIY people. /** Add New Field To Category **/ function extra_category_fields( $tag ) { $t_id = $tag->term_id; $cat_meta = get_option( "category_$t_id" ); ?> <tr class= …
answered Feb 18 '14 by Howdy_McGee
1
vote
I'm pretty sure this is a Codex error and that the string that exclude parameter expects for wp_list_categories() is really meant for non-hierarchical tags, such as blue,red where hierarchical you nee …
answered Dec 29 '15 by Howdy_McGee
1
vote
see it has both an order and orderby which we can pass in. So, to order the categories in an alpha-numeric list we can say: wp_list_categories( array( 'style' => 'none', 'orderby' => 'name', 'order' => 'ASC', ) ); You can also use DESC to change reverse order. …
answered Apr 20 '17 by Howdy_McGee
0
votes
You can use get_terms() to get an array of child slugs: /** * Get child term slugs from given term parent * * @param Integer $parent_id ( Parent Term ID ) * @param String $taxonomy ( Taxonomy Slu …
answered Jan 26 '17 by Howdy_McGee
0
votes
. Whenever you see {$taxonomy} you would replace it with whatever you taxonomy slug is. In this example I will use the default / built-in Post Categories taxonomy whose slug is category. The below will not …
answered Apr 30 '15 by Howdy_McGee
2
votes
) { location.href = "<?php echo get_option('home'); ?>"; } } dropdown.onchange = onCatChange; If you want to also include -1 (BROWSE CATEGORIES) you could change the second conditional to: dropdown.options[dropdown.selectedIndex].value <= 0 …
answered Oct 23 '14 by Howdy_McGee
1
vote
Maybe try this: /** Add Custom Taxonomy **/ function illustrations_category_taxonomy() { $labels = array( 'name' => __( 'Categories … ' ), 'singular_name' => __( 'Category' ), 'search_items' => __( 'Search Categories' ), 'all_items' => __( 'All Categories' ), 'parent_item' => __( 'Parent …
answered Sep 19 '13 by Howdy_McGee

15 30 50 per page