How to Wordpress K2 dropdown menu

Wordpress K2 is a amazing theme for Wordpress and much people wrote about it. I just want to bring some easy hacks for wordpress K2 here, like the dropdown menu for example.

Ok lets get startet… with Wordpress K2 dropdown menu!

For this Wordpress how to I use Wordpress K2 Release Candidate 3 and the bleeding edge dropdown from Simon Benjamins.

1. Replace or comment out the wordpress K2 navigation

You can find the navigation of wordpress k2 in the header.php:
[source:php]
<?php wp_list_pages(’sort_column=menu_order&depth=1&title_li=’); ?>

<?php wp_register(’<li class=”admintab”>’,'</li>’); ?>

[/source]

with …

[source:php]

//<?php wp_list_pages(’sort_column=menu_order&depth=1&title_li=’); ?>

//<?php wp_register(’<li class=”admintab”>’,'</li>’); ?>

<?php gdd_dropdown_menu(”); ?>[/source]

But please just put in under the closing DIV, like that:
[source:php]
</ul></div>
<!– dropdownmenu –>
<?php gdd_dropdown_menu(”); ?>
<hr />

[/source]

So how to fill the wordpress k2 dropdown menu?

Just write / edit a page and choose “pageparent” the main site where the new page should be.

Thats it. Now you habe wordpress k2 dropdown menu!

Update: Another possible (I do not check it out) dropdown menu for Wordpress K2 Theme is here.

Comments

22 Responses to “How to Wordpress K2 dropdown menu”

  1. links for 2007-10-29 at orioa on October 29th, 2007 05:25

    [...] How to Wordpress K2 dropdown menu | Webdesign professional K2を dropdown menu にするハック (tags: wordpress plugin menu hack) [...]

  2. Tom Boersma on October 30th, 2007 07:00

    Thanks, this works great!

  3. How to Wordpress K2 dropdown menu at Xu Sheng on December 2nd, 2007 07:36

    [...] 查看更多:http://www.webdesign-professional.eu/how-to-wordpress-k2-dropdown-menu.html [...]

  4. Ed on December 28th, 2007 17:45

    hi there. i just tried adding the drop down menu function to my website, and am encountering a few problems that i hope you can help me to solve! i am using wordpress 2.3.

    a duplicate set of page menus appear in both IE and Firefox. In Firefox, the drop down menus work fine. In IE, they dont appear at all. can you please tell me how i can fix this problem?

    i can provide additional information as needed. thanks!!

  5. Tim on December 30th, 2007 13:20

    Troubleshooting:
    Have you cleared the cache of the IE?
    Which IE-Version you use (I tested IE 6 and 7)?
    Please check the site with Opera!
    Deactivate all plugins and check again. Result?
    –>
    … Post the Php-Code of the Dropdown-inlcude (k2 header.php)

  6. Ed on January 2nd, 2008 10:00

    hi tim, thanks for the reply! yes, i have cleared the cache of IE. am using IE 6 and Firefox 2. i have also tried deactivating all my plugins but the problem remains. the php code of my k2 header.php is as follows [the dropdown code is at the very bottom]; i would really love to be able to use your dropdown menu in my site, so thanks for your help!!!:
    comment_status) or (’comment’ == $post-> comment_type) )) {
    wp_enqueue_script(’k2comments’);
    }
    ?>

    <html xmlns=”http://www.w3.org/1999/xhtml” >

    <meta http-equiv=”Content-Type” content=”; charset=” />
    <meta name=”generator” content=”WordPress ” />
    <meta name=”template” content=”K2 ” />
    <meta name=”description” content=”" />

    <link rel=”stylesheet” type=”text/css” media=”screen” href=”" />

    <link rel=”stylesheet” type=”text/css” media=”screen” href=”/css/rollingarchives.css” />

    <link rel=”stylesheet” type=”text/css” media=”screen” href=”" />

    <link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”" />
    <link rel=”alternate” type=”text/xml” title=”RSS .92″ href=”" />
    <link rel=”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”" />

    <link rel=”pingback” href=”" />

    //<![CDATA[

    K2.debug = true;

    jQuery(document).ready(function(){
    k2Search.setup(
    "",
    ""
    );
    });

    comment_status) or ('comment' == $post-> comment_type) ) { ?>
    jQuery(document).ready(function(){ OnLoadUtils(); });

    comment_status) or ('comment' == $post-> comment_type) )) { ?>
    K2.ajaxCommentsURL = "";

    //]]>

    <body class=”" >

    <a href=”/”>

    <li class=”current_page_itempage_item”><a href=”/” title=”">

    //
    //<?php wp_register(”,”); ?>

  7. Ed on January 2nd, 2008 10:07

    sorry, the entire code didnt show up in the prev comment. here is the complete code [if this doesnt work as well, i can email it to you! my email is ed@nlgx.org]:

    comment_status) or (’comment’ == $post-> comment_type) )) {
    wp_enqueue_script(’k2comments’);
    }
    ?>

    <html xmlns=”http://www.w3.org/1999/xhtml” >

    <meta http-equiv=”Content-Type” content=”; charset=” />
    <meta name=”generator” content=”WordPress ” />
    <meta name=”template” content=”K2 ” />
    <meta name=”description” content=”" />

    <link rel=”stylesheet” type=”text/css” media=”screen” href=”" />

    <link rel=”stylesheet” type=”text/css” media=”screen” href=”/css/rollingarchives.css” />

    <link rel=”stylesheet” type=”text/css” media=”screen” href=”" />

    <link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”" />
    <link rel=”alternate” type=”text/xml” title=”RSS .92″ href=”" />
    <link rel=”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”" />

    <link rel=”pingback” href=”" />

    //<![CDATA[

    K2.debug = true;

    jQuery(document).ready(function(){
    k2Search.setup(
    "",
    ""
    );
    });

    comment_status) or ('comment' == $post-> comment_type) ) { ?>
    jQuery(document).ready(function(){ OnLoadUtils(); });

    comment_status) or ('comment' == $post-> comment_type) )) { ?>
    K2.ajaxCommentsURL = "";

    //]]>

    <body class=”" >

    <a href=”/”>

    <li class=”current_page_itempage_item”><a href=”/” title=”">

    //
    //<?php wp_register(”,”); ?>

  8. ToRokZoli on January 23rd, 2008 01:53
  9. Sylvain on January 24th, 2008 10:00

    Hi, I seem to be having just the same problem as Ed…except with all navigators !

    Every page link is indeed replicated in the header navigation bar

    Just take a look at http://www.romainlevy.net/dontfollow

    Think you can help me with that ? (I too am using wordpress 2.3.1)

    Many thanks in advance for what you can do

  10. Ed on January 24th, 2008 10:19

    Hello Sylvain,

    A friend of mine helped me to resolve the issue by removing the ‘Home’ link from my top menu page links. From what I understand, the ‘Home’ link caused problems because it does not follow the same code structure as the other page links (for example, i never made made a wordpress Page for ‘Home’). Now, I just need to find out how to add in a new link for ‘Home’ without disturbing the dropdowns. Try that out next time; it’s not a 100% solution but i seem to have working dropdowns at least for the meantime. Hope that helps. My site is http://www.nlgx.org/dontfollow is case you want to see how the dropdowns work for me now.

  11. Sylvain on January 24th, 2008 10:35

    It looks great on yours ! I’d very much like to have that.

    I understand what you mean but yet
    - I don’t know how to remove the ‘home’ link (which I renamed ‘Acceuil’ in french)
    - plus I need to have a ‘home’ link

    Does anyone know any other solution to my problem ?

  12. Jack Minardi on February 6th, 2008 04:27

    Hey, I am designing a site for a client and he wants his drop downs to be links to his category pages. I see you did that with your “Topics” links. How did you get that working? Did you just hard code the information in with direct links, or is there some way to make a page that contains all posts from a topic? I have WP 2.3 and K2 installed.

    Thanks,
    Jack

  13. Benj on February 12th, 2008 08:27

    Is this only for K2?

  14. Tim Bormann on February 12th, 2008 11:00

    Of course not. The dropdown works on every wordpress theme.

  15. Benj on February 12th, 2008 18:52

    This is nice. I disabled Javascript and CSS and it is a plain unordered list lag. Is the Top post and recent post also some plugin or are these hard coded in the template?

  16. rmaspero on March 13th, 2008 23:07

    I am testing your suggestion out and am having a few problems when it comes to getting the menus to working IE6 I do what you say for the first bit but i am not sure on the second bit because when I insert it I get two menus in every other browser than IE6 and in IE6 the rest of the page gets distorted but if i only put it in once then I get IE6 not allowing me to go any further down than the first option in the drop down menu but yours work fine. would it be possible for you to upload your header PHP to show me and any other files that you have modified.

  17. Meyerbytes » 150 Blogging/Wordpress Tutorials(new comment) on December 8th, 2008 03:08

    [...] K2 Dropdown Menu [...]

  18. robin(new comment) on January 8th, 2009 23:20

    hey, i can’t find this part in my header.php though I am using the latest k2-theme with wordpress 2.7, do you know what that is about? thanx, robin

  19. robin(new comment) on January 8th, 2009 23:22

    forgot the notify-button …

  20. Winner Reale(new comment) on February 24th, 2009 14:30

    hey, i can’t find this part in my header.php though I am using the latest k2-theme with wordpress 2.7, and apache webserver do you know what that is about? thanx, Winner.

  21. eServis.net(new comment) on March 5th, 2009 13:36

    Try to restart apache after any changes.

  22. Daddy48(new comment) on October 23rd, 2009 12:25

    I venture to say that in the writings of every philosopher, whether living or dead, who has written a significant amount about philosophical problems that are hard enough to be significant, there are already some assertions that we can know to be falsehoods. ,

Leave a Reply