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
-
This is the third time you have asked this question. What you want may be possible using a custom ‘walker’ class for wp_nav_menu, but I believe the solution is too complex to be done in this forum.
vtxyzzy, thank you for your interest and your tip…
do you know any other forum you may recommend where I can find some help then?You would probably need to hire someone to do the work.
@ameraz – thanks for the tip.
@ameraz you might try asking on http://wordpress.stackexchange.com – you can get some really good, complex questions answered there.
By the way – did you even figure it out? I’m looking to do the same thing (that’s how I found your post).
The topic ‘Get Page excerpt inside Custom Menu’ is closed to new replies.