Tag Info

Hot answers tagged

2

Custom post type archive page does not need "dumb" Page. In fact, there could be the culprit. You should try this: Remove /* Template Name: Staff */ from archive-staff_member.php (not needed) Remove "dumb" stuff Page (if created). There could be some permalink conflict. Go to Admin > Settings > Permalinks and re-save it (it will regenerate rewrite rules) ...


2

the dashicon will only available to you on admin menu images. if you want it on your menu item then you must followed option B. means using awesome font library. for this you need to add it from this : http://fortawesome.github.io/Font-Awesome/ i hope this will helps.


2

When you filter wp_nav_menu, you get the nav menu arguments as second parameter $args. That's an object (a stdClass), set by WordPress while figuring out which menu to use, with an entry named menu. This is the whole nav menu object. Its title is in the entry name. Here is a trick: you can pass custom arguments to wp_nav_menu(). Let's say you are calling ...


2

The problem of building a tree from a flat array has been solved here with this, slightly modified, recursive solution: /** * Modification of "Build a tree from a flat array in PHP" * * Authors: @DSkinner, @ImmortalFirefly and @SteveEdson * * @link http://stackoverflow.com/a/28429487/2078474 */ function buildTree( array &$elements, $parentId = 0 ) ...


2

I decided to write a function to build a tree of navigation menu objects. It was a fun exercise, not sure about how it exactly will be going to be useful, but that is to say nothing, because maybe it will be practical some time. Basically - and in short - it does create the tree of objects by putting children into a new children property inside the parent ...


1

You are not providing the correct parameter to wp_get_nav_menu_object() function. It needs the menu ID or menu slug but you are providing the menu theme location. Obviously, I can not tell you what is the ID or slug of your menu. One way of getting the menu ID of the menu assigned to theme location is using get_nav_menu_locations(): $menu = ...


1

Create a template with a WP_Query to get posts with post type "post" then create a page and assign that template to that page. Templates: https://codex.wordpress.org/Templates Query by post type: https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters



Only top voted, non community-wiki answers of a minimum length are eligible