New answers tagged

0

The following plugin or his modification might be the solution for you. Automatically adds menu items by category. However, the first item must be added manually, and then you must click to automatically add subcategories in the menu item. Plugin: Add Descendants As Submenu Items https://wordpress.org/plugins/add-descendants-as-submenu-items/


0

Refer Link for Your Knowledge Template Hiearchy for a more detailed break down of how WordPress chooses the template For a taxonomy term slug ('sports' your example) in the taxonomy (e.g. 'News') WordPress will try to use the following templates (in this order) taxonomy-{taxonomy}-{slug}.php taxonomy-{taxonomy}.php taxonomy.php archive.php index.php Modify ...


0

The solution is already in your code: <?php foreach (get_categories( $args ) as $cat ) : ?> <a class="categorylink" href="<?php echo get_category_link($cat->term_id); ?>"><img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" /> More specifically: <?php foreach (get_categories( $...


2

run only on posts listed under one category I highlighted that "posts" because if so, then the conditional tag you should use is in_category() and not is_category() which is for category archive pages (e.g. example.com/category/foo) — so for example, is_category( 93 ) checks if the current archive page is for the category (with the ID of) 93, ...


0

From your question, it seems that you want to fetch the meta for the post. In which case you would want get_post_meta which would look something like this: echo get_post_meta( get_the_ID(), 'color', true ); Change the second value ('color') to whatever you have used for the meta key - I took a wild guess.


0

add_filter( 'rank_math/admin/disable_primary_term', '__return_true' ); found the solution!


1

Yes, the post_link_category hook is indeed what you would use to filter the %category% replacement value in the permalink. And here's an example with prominent_cat being the meta key and the value being the category name (e.g. Pizza Hut), where I'm using get_term_by() to get the category object/data: add_filter( 'post_link_category', 'my_post_link_category', ...


0

If there is no description disabled in the theme settings, then you will have to edit the template files. This description is displayed in the title tag of the link, and you need to look for the category_description () function in the files. If you find it, you can just comment it out.


0

Probably your CSS selector is wrong. You can filter the admin pages where your function runs and you can use an universal selector. global $pagenow; if (( $pagenow == 'edit-tags.php' ) && ($_GET['taxonomy'] == 'product_cat') && ($_GET['post_type'] == 'product') ) { add_action('admin_head', 'hide_category_buttons'); } function ...


0

There is some modification in your code, insted of this class .taxonomy-category tr:hover .row-actions apply css on this class .taxonomy-category .row-actions span.delete, it willl work. Here is whole code. add_action('admin_head', 'hide_category_buttons'); function hide_category_buttons() { echo '<style> .taxonomy-category .row-actions span....


0

You've set number to 0, so it will do as told and return 0 terms. Remove the number argument if you want all matching terms.


0

You can do this by using the pre_get_posts filter, which allows you to change they query before it is executed. In this way you can add Cat A to any request for categories. Like this: add_filter ('pre_get_posts', 'wpse380282_add_cat_a'); function wpse380282_add_cat_a ($query) { // do this only on the front end for the main query if it is a category archive ...


Top 50 recent answers are included