Print child category slug nicename

seems nobody understood ‘my question’, so I solved it myself here is the code for getting the slug I needed <?php $cat = get_term_by(‘name’, single_cat_title(”,false), ‘category’); echo $cat->slug; ?>

How to list out post category name and description in page

Use wp_list_categories Here’s all the parameters <?php $args = array( ‘show_option_all’ => ”, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘style’ => ‘list’, ‘show_count’ => 0, ‘hide_empty’ => 1, ‘use_desc_for_title’ => 1, ‘child_of’ => 0, ‘feed’ => ”, ‘feed_type’ => ”, ‘feed_image’ => ”, ‘exclude’ => ”, ‘exclude_tree’ => ”, ‘include’ => ”, ‘hierarchical’ => 1, … Read more

Show category post order ASC

EDIT When you decided to unaccept my answer and change your question in the comments to my answer I was already in bed. Please consider @kaiser comment next time when asking a question. For the purpose of my answer, here is your comment i am having problem.. actually i want to show order by alphabet … Read more

Style sub categories differently from its parent category

It will generate the structure as you have asked for. if (is_category()) { $this_category = get_category($cat); if (get_category_children($this_category->cat_ID) != “”) { echo ‘<div id=”catlist”><ul>’; $childcategories = get_categories(array( ‘orderyby’ => ‘name’, ‘hide_empty’ => false, ‘child_of’ => $this_category->cat_ID )); foreach($childcategories as $category) { echo ‘<li class=”sub-cat”>’; echo ‘<a href=”‘ . get_category_link( $category->term_id ) . ‘” title=”‘ . … Read more

How to retrieve posts from parent category, splitting them per children when displayed?

Calling WP_Query three times isn’t too good for performance, as it will make three queries to the database. The way you’re currently approaching this seems like the proper (and fastest) way in may opinion. However, you should be calling $category_posts->rewind_posts() after each while-loop to reset WP_Query‘s loop to the first post. Furthermore, your current way … Read more

How to show monthly archive posts?

Create a file date.php in your active theme and use below code, you may need to polish this code as per your requirement: <div id=”content” class=”post-archive<?php echo $content_class; ?>”> <?php if ( have_posts() ) : ?> <header class=”archive-header”> <h3 class=”archive-title”> <?php if ( is_day() ) : ?> <?php printf( __( ‘Daily Archives: %s’ ), ‘<span>’ … Read more