The reason for your not being able to use before
and after
is because when you’re calling wp_nav_menu()
with a default fallback of wp_page_menu()
, which does not have a before
and after
arguments.
Refer to line 171: http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/nav-menu-template.php#L137
Apparently the menu you are trying to get does not exist (has no items) the !$menu
is true
. Make sure you have created a menu in Appearance > Menus
and set it to a default one, or query for an existing one, or customize the fallback function, otherwise wp_page_menu
will be called, simply listing all the pages.
Related Posts:
- Two Navigation Menus – secondary nav is including main nav
- Opinions and recommendations on the best barebones base theme [closed]
- Customizing a WordPress theme without changing it?
- What is the role and history of the $content_width global variable?
- How to Link External jQuery/Javascript files with WordPress
- “Unexpected error” on update requests
- Custom Taxonomy-specific JavaScript
- Any official way to create an admin theme?
- Splitting an Evolving Site into Multiple Sites, or Maintaining as One Site?
- Loading template files from a subfolder in my theme?
- Building useful features into your theme
- Multisite: setting theme and options when a new blog is created
- Editing theme files and access to the Code pages only to super-admin?
- Change Default Image HTML
- Two Navigation Menus in Themes Produce the same menus?
- How to delete default themes
- Extra User Profile Field Upload File / Image
- Edit raw HTML of the landing page
- Problem : deletion failed, the theme requested does not exist
- Theme Activation, Create Database Tables
- Will activating a different theme preserve custom settings to current theme?
- Can I apply a WP theme to a specific custom page template?
- remove rel=next on home page but not others
- How to trigger function on theme delete?
- Setting a static home page and blog page without using the settings
- Possible to put header-{your_custom_template}.php in subdirectory?
- Renaming the Twenty Fourteen WordPress theme
- Protect changes made to the theme when updating
- Theme Development Admin Area [closed]
- How to set a single theme directory on a multisite blog?
- How to remove background image from post navigation elements?
- Static page not working
- Custom options below pages/posts editor?
- how to remove category nav from Bueno (WordPress Theme) header [closed]
- Problem of running development copy of WordPress on WebMatrix?
- How to create different navigation for registered users in WooThemes Canvas?
- Different logo on homepage
- the_content() is not displaying content, why? [closed]
- What is the correct way to integrate wordpress with another php application?
- Customizing page content layout
- Tips for managing code when developing a parent theme framework
- What Generated Classes and IDs That Is Always Used On All Themes?
- Trying to uninstall a theme, but it’s hijacking my home page
- Using the same database on another Subdomain
- How To Show Different Footers For Different Post Types Pages?
- A thin line between native wordpress bahaviour and 3rd party themes
- Create a Page template selector page
- How to include stylesheet in custom admin using parent_slug
- Custom fields not displaying on front end
- My blog suddenly can’t find my stylesheet?
- Customizing 1 theme for multiple blogs in a multisite setup
- Is there any way to modify images from a theme using the web interface?
- Get the name WordPress default theme in the core
- Default and warning messages & no login
- dynamic image path within a javascript file
- Display ads by location [closed]
- WordPress Dashboard Problem [closed]
- Theme Dev | Convert Template to Theme
- Target Internal Link Of Another Page On Website
- Work on theme files on a server & browser preview before installing it
- Create a child Theme or custom Theme
- Theme Options Menu Item – Permission Issue
- Static front page displaying twice
- Static posts page is not working
- Adding admin-ajax.php to the frontend. Good or bad idea?
- How do I add support to my theme for custom menus?
- How do I white label my self-hosted site created by wordpress?
- can require “themefolder/includes/widgets.php” in “themefolder/functions.php” yet widgets.php doesn’t run
- How to use scss in wordpress theme?
- How to get Ajax into a theme – without writing a plugin?
- WordPress as Backend, Laravel Front End: How to connect Routes?
- single.php change into a modal popup bootstrap wordpress
- get_header(‘header2’) not working properly in child themes
- Theme broken after upgrading to WordPress 4.5, missing stylesheet?
- Do not show excerpt in post content
- Modify a theme to insert custom widgets?
- Calling widget via function in themes files (hard code)
- Posts vs. Pages
- What’s the order of loading wordpress elements?
- Using _s theme, menu changes do not affect header menu
- Functions containing parameter ‘yourtheme’
- Cant remove white space on my wordpress [closed]
- How do I manually revert back to my old theme?
- Modifying the markup in the Tag Cloud widget?
- How to get theme’s info from wordpress.org/themes using api.wordpress.org?
- New to WordPress – Read the Codex, Other Docs; Still Confused
- linking to an svg through comments_popup_link
- How to use custom page templates in a theme that hides page template option?
- Create Custom Attachment Template That is Processed from Plugin Folder?
- Custom theme – pages in menu
- remove preloader in WordPress theme [closed]
- Theme translates the_author_posts_link. How can I remove their translation?
- How exactly does WordPress load themes from api.wordpress.org?
- Let custom text widget use the same font as the theme
- SSL errors when I activate my custom theme
- How to show taxonomy in WordPress shortcode
- Lightword Theme – only one menu item
- How to create an Single-Portfolio page?
- “Parse error: syntax error, unexpected” and the WordPress Theme Editor no longer working!
- Custom Menu (only showing direct cildren) ACF not showing