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"
Bookmarks inbookmarks:mine
inbookmarks: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 user 11761

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.

2
votes
So, // get all categories objects $categories = get_the_category(); // get the first category name if ( ! … empty( $categories ) ) { $category = $categories[0]->name; } $output .= '<li><a href=" ' . get_the_permalink() . ' ">'; $output .= get_the_title() . …
answered Feb 9 '18 by Max Yudin
1
vote
php $categories = get_terms( array( 'taxonomy' => 'category' 'orderby' => 'name', 'order' => 'DESC', 'hide_empty' => false ) ); …
answered Jun 7 '19 by Max Yudin
0
votes
This will work if you don't assign multiple categories to the posts. … $categories = get_the_category(); echo 'Post categories: ' . implode(', ', $categories); or just echo get_the_category_list( ', ' ); Updated according the first comment. …
answered Jun 20 '12 by Max Yudin
0
votes
As I've mentioned in the comment to the question, your loop is incomplete. You need while loop to iterate through posts and the_post() function to get those posts one by one: <?php // if there are po …
answered Feb 11 '13 by Max Yudin
0
votes
<?php $ancestors_array = get_ancestors($category_id, 'category'); $very_first_ancestor_id = end($ancestors_array); // Cat3 $parent_id = reset($ancestors_array); // Cat3.1 See Function Reference/get_ …
answered Feb 21 '13 by Max Yudin
1
vote
Category is the built-in taxonomy for posts only, not custom post types. So you have to call the pre_get_posts hook. This hook is called after the query variable object is created, but before th …
answered Oct 7 '16 by Max Yudin
-1
votes
if(is_admin() && isset($_GET['taxonomy']) && $_GET['taxonomy'] == 'category' && isset($_GET['tag_ID']) { // place your code here }
answered Dec 14 '12 by Max Yudin
0
votes
php $categories = get_categories( array( 'orderby' => 'name', // default value, can omit it 'order' => 'DESC' )); foreach($categories as $cat) { // your code goes here } …
answered Jul 6 '17 by Max Yudin
1
vote
Your category.php should have two loops — one for stickies, one for regular posts: <?php // get sticky posts array $sticky = get_option('sticky_posts'); // First WP_Query arguments $args = array( …
answered May 22 '17 by Max Yudin
1
vote
Function get_posts accepts comma separated categories' ids or slugs, not names. As it makes use of WP_Query, see Category Parameters. …
answered Dec 14 '12 by Max Yudin
3
votes
$category = get_the_category(); echo $category[0]->category_count; See /Function_Reference/get_the_category
answered Feb 7 '13 by Max Yudin
0
votes
Looks like you are using pre-4.x version of WordPress. Older version does not support array() as orderby value. Use 'orderby' => 'date comment_count' instead: <?php $category = get_the_category …
answered Mar 30 '16 by Max Yudin
1
vote
In general, categories are tied to posts only (not custom types). This is built-in taxonomy. Though there is another experience. My approach is to create custom post types and custom taxonomies. …
answered Oct 4 '16 by Max Yudin
0
votes
'Prev in this cat', // the text (%link) to be used in the span above true, // confirm that you want only this category '', // no categories
answered Feb 24 '17 by Max Yudin
0
votes
I reckon you use the image URL in your custom field. $metro_creativex_posttitle = get_the_title(); // Not used in this snippet /* // you don't need this block $metro_creativex_feat_image = wp_get_att …
answered Mar 28 '16 by Max Yudin

15 30 50 per page