• Resolved msadventures

    (@msadventures)


    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! ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter msadventures

    (@msadventures)

    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.)

    Thread Starter msadventures

    (@msadventures)

    Bump.

    Thread Starter msadventures

    (@msadventures)

    Bump.

    Thread Starter msadventures

    (@msadventures)

    Bump again. Anyone?

    Thread Starter msadventures

    (@msadventures)

    Please? I know SOMEone knows the answer. ??

    Thread Starter msadventures

    (@msadventures)

    Bump.

    Thread Starter msadventures

    (@msadventures)

    Bump. Again, I DID say “Please.” ??

    Thread Starter msadventures

    (@msadventures)

    Bump.

    Thread Starter msadventures

    (@msadventures)

    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! ??

    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!

    Thanks!!! Very helpful.

    wow! thanks!!

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

    https://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.

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Alphabetizing categories in drop-down menu.’ is closed to new replies.