use value returned from shortcode as menu item

Someone posted a similar question in the Advanced WordPress facebook group. I suggested adding some token text to the menu item’s url and then swapping it out during render. add_filter( ‘nav_menu_link_attributes’, ‘dcwd_nav_menu_link_attributes’, 10, 4 ); function dcwd_nav_menu_link_attributes( $atts, $item, $args, $depth ) { // If PHONE_NUMBER is found then change it. if ( false !== … Read more

How to create a Child & Siblings menu for a custom post type?

OK, I think I have cracked it. The below code seems to work well. To be able to use a custom post type I added an argument into the $args array’post_type’ => ‘product’, Is the below OK? <div id=”sub-pages”> <?php global $post; $args = array( ‘post_type’ => ‘product’, ‘child_of’ => get_top_ancestor_id(), ‘title_li’ => ” ); … Read more