wp_nav_menu put PHP code in Navigation Label

First time here, wonder if you can use PHP directly in the field Label Navigation Menu WP. At the moment the situation is as follows … I show you two images to understand better what I’m trying to do:

http://d.pr/i/nZ63

Read More

and this is the output of the page:

http://d.pr/i/g2sN

I want to do this is quite unusual, but also using the same php code in the description I get the same problem as above. If you use the HTML code example:<p><span> there is no problem.

Tnx U all.


ok. This is the current Test situation:

        <?php wp_nav_menu(array(
    'theme_location' => 'top_navigation',
    'menu_class' => 'nav',
        //'container_class' => 'menu-{menu slug}-container',
            'container' => false,
            //'echo' => false,
    'before' => '',
    'after' => '<span>' . wp_title() . '</span>,

no errors, no output red, but no title test!
I forget something?

Related posts

Leave a Reply

1 comment

  1. I do not usually use plugins and even in this case, I would call a function that lists out subscribers/authors.

    Recalling in this way: <?php attrac_list_authors(); ?> in any part of my WordPress, it works. If I call the function in the Navigation Label menu or in the description, this returns in an unusual output.

    At the time of this writing, I tried to use:

    'after' => '<span>' . attrac_list_authors(); . '</span>, 
    

    and seems to give better results, but I think it is the best solution.