Forum Replies Created
-
Author
-
fundlrParticipant
Damn, code has been screwed up
Hi,
The class is not automatically added by UberMenu on the
<a>
element, but only on the<li>
holder:COPY CODE<li id="menu-item-11351" class="kleo-show-login ubermenu-item ubermenu-item-type-custom ubermenu-item-object-custom ubermenu-item-11351 ubermenu-item-level-0 ubermenu-column ubermenu-column-auto"> <a class="ubermenu-target ubermenu-item-layout-default ubermenu-item-layout-text_only" href="http://site.com/wp-login.php" tabindex="0"><span class="ubermenu-target-title ubermenu-target-text">Login</span></a> </li>
I can add the class in the menu item settings, resulting in:
COPY CODE<li id="menu-item-11351" class="kleo-show-login ubermenu-item ubermenu-item-type-custom ubermenu-item-object-custom ubermenu-item-11351 ubermenu-item-level-0 ubermenu-column ubermenu-column-auto"> <a class="ubermenu-target kleo-show-login ubermenu-item-layout-default ubermenu-item-layout-text_only" href="http://site.com/wp-login.php" tabindex="0"><span class="ubermenu-target-title ubermenu-target-text">Login</span></a> </li>
Modal isn’t fired, just link to page http://site.com/wp-login.php
No Javascript errors in console.BTW it seems that none of KLEO menu items are working
I tried with Live Notifications, and My Account :COPY CODE<li id="menu-item-11354" class="kleo-menu kleo-notifications-nav kleo-toggle-menu ubermenu-item ubermenu-item-type-custom ubermenu-item-object-custom ubermenu-item-11354 ubermenu-item-level-0 ubermenu-column ubermenu-column-auto"> <a class="ubermenu-target ubermenu-item-layout-default ubermenu-item-layout-text_only" href="#" tabindex="0"><span class="ubermenu-target-title ubermenu-target-text">Live Notifications</span></a> </li> <li id="menu-item-11355" class="kleo-menu kleo-user_avatar-nav ubermenu-item ubermenu-item-type-custom ubermenu-item-object-custom ubermenu-item-11355 ubermenu-item-level-0 ubermenu-column ubermenu-column-auto"> <a class="ubermenu-target ubermenu-item-layout-default ubermenu-item-layout-text_only" href="#" tabindex="0"><span class="ubermenu-target-title ubermenu-target-text">My Account</span></a> </li>
Nothing happens on hover or click on these 2 items.
fundlrParticipantHi,
The class is not automatically added by UberMenu on the
<a>
element, but only on the<li>
holder:
<li id="menu-item-11351" class="kleo-show-login ubermenu-item ubermenu-item-type-custom ubermenu-item-object-custom ubermenu-item-11351 ubermenu-item-level-0 ubermenu-column ubermenu-column-auto"><a class="ubermenu-target ubermenu-item-layout-default ubermenu-item-layout-text_only" href="http://site.com/wp-login.php" tabindex="0"><span class="ubermenu-target-title ubermenu-target-text">Login</span></a></li>
I can add the class in the menu item settings, resulting in:
<li id=”menu-item-11351″ class=”kleo-show-login ubermenu-item ubermenu-item-type-custom ubermenu-item-object-custom ubermenu-item-11351 ubermenu-item-level-0 ubermenu-column ubermenu-column-auto”><span class=”ubermenu-target-title ubermenu-target-text”>Login</span>Modal isn’t fired, just link to page http://site.com/wp-login.php
No Javascript errors in console.BTW it seems that none of KLEO menu items are working
I tried with Live Notifications, and My Account :COPY CODE<li id="menu-item-11354" class="kleo-menu kleo-notifications-nav kleo-toggle-menu ubermenu-item ubermenu-item-type-custom ubermenu-item-object-custom ubermenu-item-11354 ubermenu-item-level-0 ubermenu-column ubermenu-column-auto"><a class="ubermenu-target ubermenu-item-layout-default ubermenu-item-layout-text_only" href="#" tabindex="0"><span class="ubermenu-target-title ubermenu-target-text">Live Notifications</span></a></li> <li id="menu-item-11355" class="kleo-menu kleo-user_avatar-nav ubermenu-item ubermenu-item-type-custom ubermenu-item-object-custom ubermenu-item-11355 ubermenu-item-level-0 ubermenu-column ubermenu-column-auto"><a class="ubermenu-target ubermenu-item-layout-default ubermenu-item-layout-text_only" href="#" tabindex="0"><span class="ubermenu-target-title ubermenu-target-text">My Account</span></a></li>
fundlrParticipantAndrei, you’re my hero!
Many thanks !Here’s my full code, for people who need it.
It displays a bootstrap progress bar in a Grid Element (Post Grid), based on custom fields values (keys: ‘current’ and ‘total’) from custom post type.In a grid element, add a Text block with this content:
{{ post_meta_value:get_custom_progress }}
In functions.php:
COPY CODEfunction get_post_id_as_custom_field($meta_value, $post_id, $meta_key, $single ){ if($meta_key == 'get_post_id'){ return $post_id; } if($meta_key == 'get_custom_progress'){ $current = (int)get_post_meta($post_id, 'current', true); $total = (int)get_post_meta($post_id, 'total', true); $prct = round($current / $total * 100); return '<div class="progress"><div class="progress-bar" aria-valuemin="0" aria-valuemax="' . $total . '" aria-valuenow="' . $current . '" style="width:' . $prct . '%">' . $prct . '%</div></div>'; } return $meta_value; } add_filter('get_post_metadata', 'get_post_id_as_custom_field', 10, 4);
One can extend this, with other than ‘get_custom_progress’, getting the needed values, and returning other markup.
Thanks again, Andrei !
fundlrParticipantAdditional info:
If I output the $post_id from the returned value in the custom shortcode (from here), it outputs nothing.
Which lead me to think that within a grid element, this is not the proper way to get the current post ID…
$post_id = (NULL === $post_id) ? $post->ID : $post_id;
Example:
My content in text block in Grid Element:
test: [field "price"]
In the shortcode function in my functions.php, I Changed
return get_post_meta($post_id, $field, true);
to
return (get_post_meta($post_id, $field, true) . '<b>'. $post_id .'</b>');
and the output is:
COPY CODE<div class="kleo_text_column wpb_content_element "> <div class="wpb_wrapper"> <p><span class="test">test: <b></b></span></p> </div> </div>
-
AuthorPosts