Get Page excerpt inside Custom Menu
-
Hello guys!!
hopefully someone can help me out!I wish to add below the anchor of a Page, inside a Custom Menu, the Page excerpt, as a brief abstract/description of the Page itself on the menu.
So first I activated the Page excerpt in the functions.php with this:
add_post_type_support( 'page', 'excerpt' );
then I declared my Custom Menu in my header.php as follows:
<?php wp_nav_menu(array('menu' => 'Main Nav Menu', 'link_after' => '<div class="abstract"><strong>Lorem ipsum</strong></div>' )); ?>
I wish to replace the “Lorem ipsum” text with something that would extract the excerpt of each page dynamically.
I already tried the_excerpt(); and get_the_excerpt(); functions with no succes, probably because Im using them outside of the loop..
Any ideas?!
Thank you in advance
- The topic ‘Get Page excerpt inside Custom Menu’ is closed to new replies.