List of post categories only associated to another custom taxonomy

Here’s what I come up with, looks like it’s working. But maybe (surely) there’s a more efficient way to do the same: // current queried $term = ‘sector’; $current_sector_id = get_queried_object_id(); // Prepare wp_query to get all posts assigned to the current “sector” $sector_posts_query = new WP_Query(); $sector_posts_query->query( array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1, … Read more

How to disable date archives?

Do you happen to use the Yoast SEO plugin? There is an option in the plugin under Search > Archives where you can switch off the Date archives. (and also Author archives if you want to).

How to link current logged-in user to their author page via URL (Beginner)

UPDATE As per the comment, here is the updated solution. Note: Before copy pasting, don’t forget to change somePrefix with any other prefix to avoid conflict with any other shortcodes. Step 1: Make sure you have this filter in functions.php (If not, copy paste it there) add_filter(‘wp_nav_menu_items’, ‘do_shortcode’); Step 2: Use this snippet to return … Read more

How to overwrite the category template in a plugin

I noticed that you’re using is_category() in your function, which means you’re targetting the default/core category taxonomy and not a custom taxonomy, hence you should instead use the category_template hook. E.g. add_filter( ‘category_template’, ‘load_new_custom_tax_template’); function load_new_custom_tax_template ($tax_template) { // I don’t check for is_category() because we’re using the category_template filter. return dirname( __FILE__ ) . … Read more

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