How to limit number of number of categories displayed by categories widget

You could show the Category widgets as a dropdown instead, if you have large number of categories. I’m not sure how useful it is to limit categories when ordered by name. You might try to order by count to display the most used categories: add_filter( ‘widget_categories_args’, function( $args ) { $args[‘number’] = 1; $args[‘orderby’] = … Read more

Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme

Twenty Sixteen does not contain any post type templates by default, thus no template selection is shown. Adding a custom foo.php file to the wp-content/themes/twentysixteen folder with the following content works just fine and reveals the template selection meta box (title: “Page Attributes”): <?php /** * Template Name: Foo Bar * Template Post Type: post, … Read more

How to have this permalink structure: post_type/postname/custom_inner_page

Register your taxonomy first and set the argument slug and rewrite rules to your slug which is city Register your post type with slug of your taxonomy city prefixed and make sure you set the has_archive argument to taxonomy. Now add a filter to post_type_link to make the stores show the individual permalink. register_post_type( ‘city’, … Read more

Two loops on archive page

From your question it is not clear which posts you want to select precisely. In any case, you clearly want to display different posts than are normally presented on the archive page. This means you will need to make a different selection in your template, using wp_query. The trick is to select the right arguments. … Read more