Editing Category Pages

First, be sure to set up a child theme – don’t edit the current theme unless it’s a completely custom one. Otherwise, whenever you update your theme, your changes will be lost. To do: Check what folder your current theme is in. As an example, say you’re using Twenty Nineteen – it’s in a twentynineteen … Read more

How to remove “Category : …”

That title is coming from archive.php file of TwentySixteen theme. You can find a <header> code section in that file. What you can do, simply copy the archive.php file as category.php and then remove the following code section from category.php file: <header class=”page-header”> <?php the_archive_title( ‘<h1 class=”page-title”>’, ‘</h1>’ ); the_archive_description( ‘<div class=”taxonomy-description”>’, ‘</div>’ ); ?> … Read more

Display Categories, Sub-categories, and Sub-sub-categories on separate pages

If I understand correctly, it certainly is possible. I would start with the function that determines if current category has parent or not. function category_has_parent($catid){ $category = get_category($catid); if ($category->category_parent > 0){ return $category->category_parent; } return false; } In the PHP template that displays your FAQ I would check if current category has parent (if … Read more

Group listed elements by category

The term you are looking for seems to be “Taxonomy”, category and post_tag are base taxonomies, but you can register more taxonomies, depending on the needs. Right now, you are in need of 2 taxonomies, “hero” and “franchise”, once registered, you can affect them to a range of post_type. I don’t know if your “movie” … Read more

Displaying multiple loops based off of category

You can use wp_get_post_terms() and in_array() to check if “investments” is in the term array or not: <?php $catquery = new WP_Query(array( ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ )); ?> <?php while($catquery->have_posts()) : $catquery->the_post(); ?> <?php $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ‘large’ );?> <?php // Gather all the post terms for the post. $post_term_objects = wp_get_post_terms( … Read more

Need to pull parent category and slug – only pulling daughter category

There are functions for retrieving a term/category link (i.e. URL to the term archive page) and in the case of the default category taxonomy, you can use get_category_link(): <a href=”https://wordpress.stackexchange.com/questions/361461/<?php echo esc_url( get_category_link( $category[0] ) ); ?>”><?php echo $category[0]->name; ?></a> For custom taxonomies, you’d use get_term_link().

Set post categories to include parents when setting child category

This will check to see if there is a hierarchy and set all parent categories as checked. This function assumes that if there’s multiple categories already set, then don’t do the function, since the categories would be correct if multiples are set. function set_product_parent_categories( $post_id ) { $category = wp_get_post_terms( $post_id, ‘product_cat’ ); // If … Read more