Category pages redirecting to tab on Posts page grid
For now I have done this via category.php /* Redirect Category to Post Grid tab */ <?php $cat = get_queried_object(); wp_redirect( site_url(‘/locations/’).’?tx_category=’.$cat->slug ); exit();
For now I have done this via category.php /* Redirect Category to Post Grid tab */ <?php $cat = get_queried_object(); wp_redirect( site_url(‘/locations/’).’?tx_category=’.$cat->slug ); exit();
Show alternative menu based on page template AND post category
I suggest the following: $categories = get_the_category(); $category_ids = wp_list_pluck( $categories, ‘term_id’ ); $args = [ ‘numberposts’ => 4, ‘category__in’ => $category_ids, ]; $related_posts = get_posts( $args ); $related_posts = wp_list_filter( $related_posts, [ ‘ID’ => get_queried_oject_id() ], ‘NOT’ ); if ( count( $related_posts > 3 ) ) { array_pop( $related_posts ); } global $post; foreach … Read more
Wrong category in URLs accepted like the correct one
I didn’t find the cause. But I was able to hack a solution into functions.php: add_action(“wp”, “disable_duplicate_categories”); function disable_duplicate_categories() { if (is_category()) { $urlParts = explode(“https://wordpress.stackexchange.com/”, $_SERVER[“REQUEST_URI”]); if ($urlParts[1] !== ‘category’) { array_splice($urlParts, 1, 0, ‘category’); $url = implode(“https://wordpress.stackexchange.com/”, $urlParts); header(“Location: “.$url,TRUE,301); exit; } } } The unwanted pages are never linked to, so the … Read more
It depends on the WordPress theme you’re using. If you can find out what html class the category/post meta is under using Inspect Element, it will be easy to hide it via CSS. Otherwise you will need to find where the ‘Post Meta Data’ is being added in PHP inside your theme and remove it. … Read more
Displaying a Category on a WordPress Page
There are several robots.txt generators online. Here is one of my favorites. After you’ve generated your file, I highly recommend testing it with Google’s Webmaster Tools tester. I’ve done this for dozens of sites, and never have a problem. Just remember the following: Most WordPress sites treat categories as if they’re folders/directories. So, to make … Read more
Another user has provided sample code in a separate thread. Reading their code, it appears to be just what you’re looking for. Good luck!
Function add class to second menu specific items if the page has a certain category