Tag Info

New answers tagged

0

The easiest thing to whitelist page IDs for wp_list_pages() is to use a self removing/single time running filter callback inside get_pages(), which is the function retrieving the data from either Cache or from a fresh query to the DB. You have several options in there: Filter the final DB result To filter the list of returned pages, you can build yourself ...


0

May be easier to just work with it, than against it... Instead of: $cat_id = sanitize_text_field($_POST['cat']); Try: $cat_name = sanitize_text_field( $_POST['cat'] ); $cat = get_term_by( 'name', $cat_name, 'category' ); $cat_id = $cat->term_id;


0

Thank god.. i've solved it my own. this is the function i used to update the anchor tags. function my_walker_nav($item_output, $item, $depth, $args) { $menu_locations = get_nav_menu_locations(); if(!empty( $item->description )) $description = $item->description; else { $description = ''; } if ($item->menu_order == 1){ $item_output ...


0

Fortunately, there is an easy fix for this. The $item in the Walker delivers Classes, and if the menu item is an archive, you get one of those: menu-item-type-taxonomy (general) menu-item-object-product_cat (product_cat == taxonomyname) as well as $item->type == 'taxonomy' $item->object == 'your_taxonomy' If you want this logic to work for various ...



Top 50 recent answers are included