Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter samanthagrimm

    (@samanthagrimm)

    If anybody has this issue – here is what happened:

    I use Polylang to have enable multi-language. Products had not been set to have a language, but the product taxonomies were.

    Once I set the product to have multiple languages and had polylang update all the current posts and products that didn’t have an assigned language to the default language, everything was fixed.

    Good luck!

    samanthagrimm

    (@samanthagrimm)

    Hi,

    I was having the same issue. After looking around a bunch, this is what I came up with that works: You need to create a private variable outside your functions. I used the item’s ID instead of name.

    
    class My_Walker_Nav_Menu extends Walker_Nav_Menu {
    		private $curItemID;
    function start_lvl(&$output, $depth=0, $args = array() ) {
    			 $itemID = $this->curItemID;
    	     $indent = str_repeat("\t", $depth);
    	     $output .= "\n$indent<ul id=\"dropdown".esc_attr($itemID)."\" class=\"sub-menu\" >\n";
    	   }
    
    function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 )
    	  {
    	    global $wp_query, $wpdb;
    			$this->curItemID = $item->ID;
    ...

    I hope this helps!

Viewing 2 replies - 1 through 2 (of 2 total)