Tagged: x
-
AuthorPosts
-
February 9, 2017 at 4:37 am #1364098
ATCompressorsParticipantMorning X-Team. 🙂
I found the following thread in the forums about activating the descriptions for mega menus.
mega-menu-description-field-cornerstone-updateThe following jQuery was provided by one of you wonderful X-Men but it doesn’t seem to work on the Integrity stack.
add_filter( 'walker_nav_menu_start_el', 'gt_add_menu_item_description', 10, 4); function gt_add_menu_item_description( $item_output, $item, $depth, $args ) { $desc = __( $item->post_content ); if($desc){ return preg_replace('/(<a.*?><span>[^<]*?<\/span>)</', '$1'."<small class='nav-desc'>{$desc}</small><" , $item_output); } return $item_output; }I’m not the best with JS or jQuery, so I would be super grateful if you could advise how I could alter the code to work on my website.
I’ll leave my login credentials separately. 🙂February 9, 2017 at 4:38 am #1364112
ATCompressorsParticipantThis reply has been marked as private.February 9, 2017 at 3:43 pm #1364850
RadModeratorHi there,
Thanks for posting in.
Would you mind providing your FTP login credentials as well? I just like to test it. It’s not a javascript, but PHP 🙂
Thanks!
February 10, 2017 at 9:54 am #1365967
ATCompressorsParticipantThis reply has been marked as private.February 10, 2017 at 6:17 pm #1366491
RadModeratorHi there,
Ah your descriptions are from custom link, the above code is only applicable for menu item as post type.
I went ahead and implemented the correct one, and please add this CSS to Admin > Appearance > Customizer > Custom > CSS for format the description.
.sub-menu .nav-desc { display: block; width: 100%; }Hope this helps.
February 15, 2017 at 8:17 am #1371966
ATCompressorsParticipantRad! You’re the absolute best!
Thank you so very much for your help. 😀February 15, 2017 at 10:08 am #1372115
JoaoModeratorGlad to hear it
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1364098 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
