View Single Post
  #62  
Old February 23rd, 2012, 04:23 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Ok, there were 2 problems: one with my code and one with your code. I've made all of these changes for you so there's no need to do anything. But for future reference:

1. I needed to declare which menu I wanted to put the drop down into. This is why the menu was appearing in both the Primary and Secondary menu. So, the new PHP code for the functions.php file should be:
PHP Code:
// Add store categories to nav menu
function dfr_menu_items($items$args) {
    if (
$args->theme_location == 'primary') {
        
$cats str_replace(array("<div>","</div>"), array("",""), datafeedr_tag('Category List?c=%ci'));
        
$items $items $cats;
    }
    return 
$items;
}
add_filter'wp_nav_menu_items''dfr_menu_items'10); 
2. The second problem was your code in your View. The HTML code for your Category List module needed to be:
HTML Code:
[category.list id='dfparent' before='' after='']
<li>
  <a href="[category.link]" title="[category.name]">[category.name]</a>
  [category.list id='dfchild' before='<ul>' after='</ul>']
    <li>
      <a href="[category.link]" title="[category.name]">[category.name]</a>
      [category.repeat id='dfchild']
    </li>
  [/category.list]
</li>
[/category.list]
And for documentation purposes, the settings on the Genesis Theme Settings page look like this:



And a menu should be selected for the Primary Menu on this page: WordPress Admin Area > Appearance > Menus

That should do it. You are up and running now.

Eric