WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Alphabetizing categories in drop-down menu. (15 posts)

  1. msadventures
    Member
    Posted 8 years ago #

    Hi all, I'm tinkering today. Decided to put a drop-down menu on my site for my categories, since I have a fair few. I read through the archives and found the code for alphabetizing, so I put that in and it worked fine. Then installed the code for the drop down box and that worked fine. I managed to put the two together and even integrate it into my theme without making my computer explode. But now the alphabetizing doesn't work, I've probably got it in the wrong spot or something. Can someone have a look and let me know what I've got wrong here?

    <h2><?php _e('Post Categories:'); ?></h2>
    <ul>
    <li>
    <form action="<?php echo $PHP_SELF ?>" method="get">
    <div style="text-align:center">
    <?php dropdown_cats('sort_column=name'); ?>

    <input type="submit" name="submit" value="Go!" />

    </div>
    </form>
    </li>
    </ul>

    Thanks! :)

  2. msadventures
    Member
    Posted 8 years ago #

    Also, how would I get the word "Choose..." to show up in the drop down menu, instead of one of the category names, prior to someone clicking the menu and scrolling through the category names?

    (Wow, I hope someone understood that.)

  3. msadventures
    Member
    Posted 8 years ago #

    Bump.

  4. msadventures
    Member
    Posted 8 years ago #

    Bump.

  5. msadventures
    Member
    Posted 8 years ago #

    Bump again. Anyone?

  6. msadventures
    Member
    Posted 8 years ago #

    Please? I know SOMEone knows the answer. :)

  7. msadventures
    Member
    Posted 8 years ago #

    Bump.

  8. msadventures
    Member
    Posted 8 years ago #

    Bump. Again, I DID say "Please." :)

  9. msadventures
    Member
    Posted 8 years ago #

    Bump.

  10. msadventures
    Member
    Posted 8 years ago #

    Okay, got some help and fixed the code. Here's how I wrote it:

    <ul>
    <li>
    <form action="<?php echo $PHP_SELF ?>" method="get">
    <div style="text-align:center">
    <p><?php dropdown_cats(TRUE, 'Choose...', 'NAME'); ?></p>
    <p><input type="submit" name="submit" value="Go!" /></p>
    </div>
    </form>
    </li>
    </ul>

    That code gave me a drop down menu for my categories, alphabetized the categories, put the word "Choose" in the drop down menu window instead of one of my category names, and integrated the drop down menu into my theme - including removing the bullet that showed up when I first put the drop down menu in my code.

    Thanks to pundit/wahgnube for the help! :)

  11. MisterSparkle1
    Member
    Posted 8 years ago #

    I must commend you. I've been looking for an answer for this for a few days. Glad you found the answer. Works perfectly.

    THANKS!

  12. doubledubs
    Member
    Posted 8 years ago #

    Thanks!!! Very helpful.

  13. thatshot
    Member
    Posted 8 years ago #

    wow! thanks!!

  14. jedimacfan
    Member
    Posted 7 years ago #

    I've implemented this on my blog but have a troubleshooting question.

    http://www.oldfishandlemonade.com

    I like to have the search bar in my header, but this causes a problem when someone looks at a blog entry directly and tries to use the Category option.

    When someone visits a direct link and tries to switch categories, the code places "?cat=18&submit=Go+Fish" at the end of the blog entry's URL. Is it possible to change the code someone so that it always starts from the domain itself, as it normally would if you try to switch categories from the main page? This would be a great help to me. Thank you.

  15. jedimacfan
    Member
    Posted 7 years ago #

    NM, removing "<?php echo $PHP_SELF ?>" solves this issue. Figured it out (I think).

Topic Closed

This topic has been closed to new replies.

About this Topic