Category page doesn’t use category.php, instead it redirects to homepage
Check that your category.php file has no errors first. Go to Settings -> Permalinks and save it again to rebuild your permalink structure just in case.
Check that your category.php file has no errors first. Go to Settings -> Permalinks and save it again to rebuild your permalink structure just in case.
There is a plugin for that called WP No Category Base. As the name suggests this plugin will completely remove the mandatory ‘Category Base’ from your category permalinks ( e.g. myblog.com/category/my-category/ to myblog.com/my-category/ ). https://wordpress.org/plugins/wp-no-category-base/
Just of the top of my head, something along this way might work: function wpse178647_rewrite() { add_rewrite_rule( ‘^([^/]+)/([^/]+)/?$’, ” ‘index.php?category_name=$matches[1]&pagename=$matches[2]’, ‘top’ ); } add_action( ‘init’, ‘wpse178647_rewrite’ ); Completely and utterly untested.
Maybe this can help delete_option(‘taxonomy-slug_children’); just replace the ‘taxonomy-slug’ with ‘cat’ or other taxonomy you are using. This line is supposed to used in the same action hook function, right after you create the term.
There is no date-based archive for a category. The /category/[slug]/ pages are already “archives”, in that they display old posts over different pages. The different pages can be accessed by adding page/2/, page/3/, … to the URL. The template tags to add these links are next_posts_link() and previous_posts_link(). If you want to add a date-based … Read more
Fairly simple using jQuery and global $typenow ex: add_action(‘admin_print_scripts-post.php’, ‘my_publish_admin_hook’); add_action(‘admin_print_scripts-post-new.php’, ‘my_publish_admin_hook’); function my_publish_admin_hook(){ global $typenow; if (in_array($typenow, array(‘post’,’page’,’mm_photo ‘))){ ?> <script language=”javascript” type=”text/javascript”> jQuery(document).ready(function() { jQuery(‘#post’).submit(function() { if (jQuery(“#set-post-thumbnail”).find(‘img’).size() > 0) { jQuery(‘#ajax-loading’).hide(); jQuery(‘#publish’).removeClass(‘button-primary-disabled’); return true; }else{ alert(“please set a featured image!!!”); jQuery(‘#ajax-loading’).hide(); jQuery(‘#publish’).removeClass(‘button-primary-disabled’); return false; } return false; }); }); </script> <?php } … Read more
get_ancestors() returns an array containing the parents of any given object. This example has two categories. The parent with the id of 447 and the child with a id of 448 and returns the a category hierarchy (with IDs): get_ancestors( 448, ‘category’ ); returns: Array ( [0] => 447 ) get_ancestors Codex Page
It should be enough using a single <span> for all categories and add some logic.: <span><?php $categories = [‘horses’,’dogs’,’birds’]; $string = “”; foreach ($categories as $category){ //iterate over the categories to check if(has_category($category)) $string .= $category.”, “; //if in_category add to the output } $string = trim($string); //remove extra space from end $string = rtrim($string, … Read more
There is extensive documentation on the database structure of WordPress in the Codex. Its pretty simple but still you probably do not want to mess with the data directly. As you mentioned CLI I’d recommend WP-CLI which offers some commands you need. A quick example from the docs to change the name of the term … Read more
Using Parent-Child Page (Recommended) If you don’t have to have categories & posts, then this can be easily achieved using parent-child pages (not posts). For example, say you have three pages like: www.example.com/category-one/ www.example.com/category-two/ www.example.com/category-three/ Now you can have child pages for the above pages with slug email, e.g. www.example.com/category-one/email www.example.com/category-two/email www.example.com/category-three/email This is possible … Read more