How to create category page

You’ll want to stick something like this in your theme’s category.php file: <?php // fetch the categories with the parent being the current cat $sub_cats = get_terms(‘category’, array( ‘parent’ => get_queried_object_id() )); if(!is_wp_error($sub_cats) && $sub_cats) { foreach($sub_cats as $cat) { // Create your grid here, this is just an example printf( ‘<a href=”https://wordpress.stackexchange.com/questions/57529/%s”>%s</a>’, get_term_link($cat, $cat->taxonomy), … Read more

WordPress Loop Prob

Right now it seems like there is no query regarding the amount of posts to be shown. Try adding this above your WHILE argument: global $query_string; query_posts( $query_string . ‘&posts_per_page=5’ );

Assign a category by user and customize the edit-tags.php?taxonomy=category page

This is how I did it : function if_restrict_categories($categories) { global $current_user; $a = get_cat_if_user($current_user->ID); $onPostPage = (strpos($_SERVER[‘PHP_SELF’], ‘edit-tags.php’)); if (is_admin() && $onPostPage && !current_user_can(‘level_10’)) { $size = count($categories); for ($i = 0; $i < $size; $i++) { if($categories[$i]->parent != $a && $categories[$i]->term_id != $a){ unset($categories[$i]); } } } return $categories; } add_filter(‘get_terms’, ‘if_restrict_categories’); And … Read more

How to make wp dropdown category load with selected option on top?

if the currently selected item has some type of identifier on it (maybe class=”current”) you may be able to use some jquery to grab it’s value, hide it, then move it to the top. <div class=”topdiv”> this is top div </div> <ul> <li>1</li> <li class=”current”>2</li> </ul> (function() { var top = $(‘.current’).html(); $(‘.current’).hide(); $(‘.topdiv’).text(top); })(); … Read more

Show custom menu in category and its posts

Well it looks like you are using theme that doesn’t have custom menu supporting code inside post and category templates. Since it’s working fine in page template you should go to Appearance -> Editor and open for editing page.php or index.php and look for wp_nav_menu() with all it’s arguments. Select and copy and insert it … Read more

Make a menu visible for a single category and it’s content

In order to display any specific conditional content on a single post based on it’s category, you have to edit the template called single.php. e.g. put something like this in single.php if ( in_category( ‘category1’ )) { //code for category1 } elseif ( in_category( array( ‘category2’, ‘category3’ ) )) { // code for when t … Read more

get latest post in category date

Unfortunately no; the categories are stored separately in the database and would each require their own query. I like to stick to built in wordpress functions as much as possible, but you could make a custom query to find the latest post from each category using the wp_term_relationships table. It stores the post id (object_id) … Read more