Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   Drop down menu (/showthread.php?t=8710)

nzcid March 1st, 2013 07:06 PM

Drop down menu
 
Store 35251

urLhttp://www.chinawholesalectronics.com/

The theme is the socrates theme.

What I like to do is attach a drop down menu of all the categories to the primary (main) wordpress navigation bar.

Searching I found what you do in the twenty ten theme but was wondering what I could do for my theme.

Many thanks

Eric March 1st, 2013 07:52 PM

Hi,

As long as your theme references the wp_nav_menu() function, this method will also work for you.

If it does not work, you will need to ask the theme developer how to hook into the menu function.

Eric

nzcid March 1st, 2013 08:13 PM

Quote:

Originally Posted by Eric (Post 40167)
Hi,

As long as your theme references the wp_nav_menu() function, this method will also work for you.

If it does not work, you will need to ask the theme developer how to hook into the menu function.

Eric

Hey Eric

Here I take it you are talking about the themes functions.php Yes?

nzcid March 1st, 2013 08:33 PM

Quote:

Originally Posted by nzcid (Post 40168)
Hey Eric

Here I take it you are talking about the themes functions.php Yes?

Silly question of course you are.

Only thing I can find in the themes functions.php is this line

require_once($functions_path . 'menus.php'); // Menus WP 3.0

And the last entries in that file are

Code:

// Hook into the 'wp_dashboard_setup' action to register our other functions



add_action('wp_dashboard_setup', 'add_socrates_dashboard_widget');



function customize_meta_boxes() {

    //retrieve current user info

    global $current_user;

    get_currentuserinfo();

   

    //if current user level is less than 3, remove the postcustom meta box

    if ($current_user->user_level < 10)

        remove_meta_box('socrates_dashboard_widget', 'dashboard', 'normal');

}



add_action('admin_init', 'customize_meta_boxes');

So where would you place your code?

nzcid March 1st, 2013 08:48 PM

Okay it appears that function file has no closing tag for whatever reason as it must be calling other files to close the tag.

Anyways I added your code to the bottom of the functions file and added the category list and see what happened.

http://www.chinawholesalectronics.com/

Now how it looks and works is not a bad thing for me but be nice to know how to change it to a drop down menu.

Eric March 2nd, 2013 09:05 AM

Hi,

Everything is working as expected. What do you mean change it to a drop down menu? All of your categories are parent categories therefore there's no hierarchy.

Eric

nzcid March 2nd, 2013 03:33 PM

Quote:

Originally Posted by Eric (Post 40181)
Hi,

Everything is working as expected. What do you mean change it to a drop down menu? All of your categories are parent categories therefore there's no hierarchy.

Eric

Hey Eric

So in esscence if I created an empty category with some name (Like Electronics) and shifted everything under it then they would all appear under that one category whatever it was named on the menu bar, correct.

Eric March 2nd, 2013 03:35 PM

Hi

Yes, but I don't recommend that. If you want all of your categories to appear under 1 link in your menu, try this: /show...1913#post21913

Eric


All times are GMT -5. The time now is 01:10 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.