Skip to main content
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
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
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 not deleted user 6035

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
Accepted

How to create category page

php // fetch the categories with the parent being the current cat $sub_cats = get_terms('category', array( 'parent' => get_queried_object_id() )); if(! …
chrisguitarguy's user avatar
2 votes

How do I automatically put categories and their descriptions on a WP Page?

First you need to get all the categories that don't have parents (top-level categories). We're going to use get_terms for this. … $cats || is_wp_error( $cats ) ) return; With that in place we can start by outputing a container div, then starting a foreach loop to loop through all the categories. …
chrisguitarguy's user avatar
1 vote

Different Output for "Every Other" Foreach Statement?

You can use a loop counter to accomplish this. Set up a counter variable before you loop, check to see if it divided by 2 returns a 0 remainder (in this case) and adjust the class accordingly. Increm …
chrisguitarguy's user avatar
1 vote

Is custom menu name and category name linked in wordpress?

Nav Menus are actually taxonomies -- eg. they are registered with register_taxonomy and get used to associated menu items (which are, of course, a custom post type!). Slugs, which is what you're tryi …
chrisguitarguy's user avatar
1 vote

Get post content intro text on category.php?

You're using an old version of WordPress. Upgrade to 3.5 and you will no longer see that error. Here's the function declaration for get_post in WP 3.4: function &get_post(&$post, $output = OBJECT, $ …
chrisguitarguy's user avatar
1 vote
Accepted

get_the_category_list open in parent window

get_the_category_list runs it output through the filter the_category. You could hook in there and change whatever you like. Something like this should work (untested): <?php add_filter('the_categor …
chrisguitarguy's user avatar
2 votes

How to show a category post to a specific registered user

Skip to that if you don't need a way to associate categories with users. So first off, let's wrap everything up in a class. … Our field will grab all the current categories and put them in a drop down menu. We'll also output a nonce field that we'll check later on saving the user. <? …
chrisguitarguy's user avatar
7 votes
Accepted

Allow users to create their own feed from selected categories?

edit_user_profile fires when they edit another's profile -- this is how your admin user will go in an edit user's categories. <? … php /** * Get the categories available for use with this plugin. …
chrisguitarguy's user avatar
3 votes

How to group the loop posts in a particular by author?

I don't think you need to get the list of authors in a given category or use a bunch of individual WP_Query's, you just need to order posts by author and check to see when the author changes. Two par …
chrisguitarguy's user avatar
1 vote
Accepted

Inserting Category programmatically

Keep track of the return value of wp_insert_term and use it to build your structure. A successful return value will be an array with a term_id key that you can pass into wp_insert_term's $args array a …
chrisguitarguy's user avatar
10 votes

Get rid of Wordpress category, tag and author archives?

To disable categories, tags, author and date archives: <? …
chrisguitarguy's user avatar
9 votes

Category archive by year with permalink support /category/YYYY

What you're looking for is an endpoint. There are already several of these built in: /feed/some-feed/ for feeds or /trackback/ on posts. Those are both endpoints. Fortunately, WordPress provides a …
chrisguitarguy's user avatar
5 votes
Accepted

Rewrite category wordpress

You can do this with a rewrite rule from within WordPress. Take a look at the documentation for add_rewrite_rule. Something like this: <?php add_action('init', 'wpse65855_rewrite'); function wpse65 …
chrisguitarguy's user avatar
0 votes
Accepted

How can I sort posts ascending by post title for a specific post type, but on a category arc...

You can use pre_get_posts to hook in and change the query. The argument passed to pre_get_posts is the query object. It fires for every query, so you need to check some things first. Quick example (n …
chrisguitarguy's user avatar
1 vote
Accepted

WP Query group/order by category name

There are a few ways you can do this. The simplest is to just get everything: posts and terms, then use some array_filter magic to group things. Simple example (that will only work with PHP 5.3+): < …
chrisguitarguy's user avatar