Is there ant way in order to fix the following BUG?
Could be a solution using the new slider element with sile buttons?
Is it possible to use WP MENU as Looper Provider?
Is there any way in order to highlight Active Link?
Thank You
Daniele
Is there ant way in order to fix the following BUG?
Could be a solution using the new slider element with sile buttons?
Is it possible to use WP MENU as Looper Provider?
Is there any way in order to highlight Active Link?
Thank You
Daniele
Hi Daniele,
Unfortunately, there is no news on the bug reported into the issue tracker. Alternatively you can try the Logo Carousel Slider for similar purposes.
You can get the Menu Items through the Custom Looper Provider. You need to add the following function into the functions.php of your child theme.
add_filter("cs_looper_custom_menuitems", function($result, $args)
{
$menu_name=$args["menu_name"];
$menuLocations = get_nav_menu_locations();
$menuID = $menuLocations[$menu_name];
$primaryNav = wp_get_nav_menu_items($menuID);
foreach ($primaryNav as $m)
{
if($m->menu_item_parent==0)
{
$menu[$m->ID] = array();
$menu[$m->ID]["ID"] = $m->ID;
$menu[$m->ID]["title"] = $m->title;
$menu[$m->ID]["url"] = $m->url;
$menu[$m->ID]["menu_item_parent "] =$m->menu_item_parent ;
$menu[$m->ID]["children"] = array();
}
}
return $menu;
}, 10, 2);
Then you need to call this where you want to implement the Looper, I have tested it in my local environment and called this into the Column and displayed the Menu Title and URL in a Text element. I have also sent the JSON parameter to the custom Looper, with the Menu Name which needs to be shown.
{
"menu_name":"primary"
}
Hope it helps.
Thanks
Hi tristup
Thank You for your precious support
I’d like to ask you some info:
P.S. Is there any way in order to highlight Active Link?
Thank You
Hi Daniele,
You can use the get_post_meta
function and meta_key menu-item-anchor_graphic_icon
to fetch the icon value stored for the specific menu item. The following code need to be added into the Custom Looper function.
$menu[$m->ID]["icon"] = get_post_meta($m->ID,'menu-item-anchor_graphic_icon',true);
And then you need to add the following code to get the icon value using the Dynamic Content tag.
{{dc:looper:field key="icon"}}
But please remember that the value does not show the icons which you might be trying, it required complex programming and you’d need to consult with our Elite team, or else you can hire a developer who can assist you to do the customization.
Hope it helps.
Thanks
Dear tristup
I receive an error:
Warning : Invalid argument supplied for foreach() in /home/customer/www/agenziagammariccione.it/public_html/wp-content/themes/pro-child/functions.php on line 331
at the following instruction:
foreach ($primaryNav as $m)
Maybe the problem is the MENU Name that I send through JSON:
{ "menu_name" : "Menu-Sub-Utilita" }
Maybe I have to send MENU Name with another format?
P.S. Is there any way in order to highlight Active Link?
Hi Daniele,
As per the error shown, it seems that the Menu does not contain any item. It might be due to the Menu name provided is not correct or not in a correct format. I would suggest you rename the menu to a smaller name like primary or secondary and check if that works.
Please remember that investigating custom code and the errors related to it is outside the scope of Theme Support. I would suggest you hire a developer who can assist you to do the customization or you can avail of our newly launched service called One, where we answer the questions beyond normal theme support.
Thanks
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.