Display list of Sub-Categories and the posts they contain, within one main Category

Question was answered on another site.. thank you! BTW, the code that accomplished what I needed was: $categories = get_categories(‘child_of=31’); foreach ($categories as $category) { //Display the sub category information using $category values like $category->cat_name echo ‘<h2>’.$category->name.'</h2>’; echo ‘<ul>’; foreach (get_posts(‘cat=”.$category->term_id) as $post) { setup_postdata( $post ); echo “<li><a href=”‘.get_permalink($post->ID).'”>’.get_the_title().'</a></li>’; } echo ‘</ul>’; }

Are Categories, Tags and Custom Taxonomies any different in regards to SEO?

Short answer: No. When you’re working with SEO, there are three things to take into account: Site content Site meta descriptions Site findability (it’s a word, I swear!) Site Content Search engines will parse your site’s content looking for content and keywords. Create good, useful content and it will be fetched, parsed, and recorded appropriately. … Read more

How to Make a Categories Meta Box with Hierarchical Checkboxes on Frontend?

Try wp_terms_checklist() / wp_category_checklist. It will output a list of checkboxes named post_category. You might need to include the source file too, because it’s defined within administration files. Or use a custom walker: class MyCategoryWalker extends Walker_Category{ public function start_el(&$output, $term, $depth, $args){ $args = wp_parse_args(array( ‘name’ => ‘my_category_input’, ‘checked’ => array(), ), $args); extract($args); … Read more

Categories’ hierarchy in URL

The permastruct /%category%/%postname%/ will include the categories and subcategories in the URL from top to first assigned child. So, if you want the URL be site.com/source/books/moby-dick/*postname*, you have to assign the post only to “Moby Dick”. Assigning the post only to “Moby Dick” category will still show the post under “source” and “books” category archives … Read more

Send an email when custom post type category is changed

Use the hooks added_term_relationship and deleted_term_relationships. These only fire when the relationship changes, as opposed to set_object_terms which always fires: function wpse_181090_object_terms_updated( $object_id ) { static $did = array(); // This function might fire multiple times for the same object, ensure it only runs once if ( ! isset( $did[ $object_id ] ) ) { … Read more

Trash bin for categories

This would be quite challenging to implement. Posts can be trashed because: They have a concept of status and corresponding field in database table WordPress code “knows” to only deal with posts of appropriate status for most purposes This solves issues of visibility (posts won’t appear on front end) and interaction (trashed posts won’t show … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)