Categorías sin botón de envio

Share/Save

Una de las razones al precipitado lanzamiento de este blog es lo qué estás buscando ahora mismo, el plugin que muestre tus categorias sin el dichoso botón submit, así que es más que justo que este plugin sea la primera entrada de este bloque

Cómo funciona

Funciona exáctamente igual que la función wp_dropdown_categories(). Tan sólo le he añadido el argumento “onchange” a la función original para hacer posible el uso del evento onchange(), y el formulario obligatorio porque la función original no lo incluye.

Valores aceptados por “onchange”:

Instalación y configuración

  1. Descarga altrugon_dropdown_categories.zip
  2. Descromprime el fichero
  3. Copia la carpeta altrugon_dropdown_categories en tu directorio wp-content/plugins
  4. Activa el plugin
  5. Pega esta linea en tu código: <?php altrugon_dropdown_categories(’onchange_submit=1′); ?>
  6. Disfruta

Versiones

  • v1.2: Añade un “option” vacio en el select box. Esto es necesario cuando no tienes botón de envio.
  • v1.1: Corrige un problema de validación XHTML. He puesto el select box dentro de un div que a su vez tiene una clase.

Bien, esto es todo. Si tienes alguna pregunta o sugerencia no dudes en contactar conmigo.

Share/Save

24 Responses to “Categorías sin botón de envio”

  1. I get the following error when I use your plug in:

    Fatal error: Call to undefined function: get_categories() in /home/republic/public_html/wp-content/plugins/altrugon_dropdown_categories.php on line 48

  2. Where in my code do I place that line? I assumed I just put it in the sidebar where I want the categories to show up, but that produced an error that didn’t let any of my content load. Plugin is installed and activated. Is there somewhere else I’m supposed to put that line?
    Thank you!

  3. Mike which version of WordPress are you using. This plugin only works with WordPress 2.1.

    Try to download the plugin again; I uploaded the plugin yesterday because I found some mistakes. Make sure you clean your cache when you reinstall the plugin.

  4. Lolly you can paste the line in your sidebar replacing the code that was showing your categories. It should works fine, but could you give me more information about the error, or could you show me the piece of code where you pasted the new function?.

  5. Great plugin!

    Thanks so much for sharing this with us..

    Lolly – Make sure you copy the line in your side bar from the read me file. Sometimes if you just copy and paste the line from here you get extra characters in it which may cause an error.

  6. I have wp 2.1.3 installed, found a solution almost like I was looking for, wp_dropdown_categories(), previous code was called from widgets.php (I am using widgets) and lokked like this:
    <code>

    </code>
    I replaced it with:
    <code>

    </code>
    (I previously activated the plugin of course)

    Nothing worked, the site returned an error. Maybe this is due to the widgets plugin that I am using?

  7. UncleSam I can’t see your code at all, however I’m using widgets with this theme and it works fine for me. What I did was to go to the php file that holds the category widget and over there I put the piece of code that you need to call the plugin.

    I hope this will help you.

  8. Am hoping to get your plugin working for my site. I’ve got it installed/activated. I placed the text from the readme in my sidebar template, but I get “Parse error: syntax error, unexpected ‘=’ in” and no other sidebar information when I save the template.

  9. Ahhhhh of course it was my fault. It works perfectly now that I removed my earlier attempt at a javascript drop-down. (Silly me)

    Just one question now. Is there an option to sort the drop-down list alphabetically?

  10. Paul is totally possible because the plugin accepts the same parameters that the wp_dropdown_categories() function. There is a link on top of this post that will send you to the description function page in the wordpress site if you want to check which parameters you can use.

  11. Works great, thanks!!

  12. Ok, I’ve been using it a couple days now and it’s great. I have the working drop-down and everything is sorted the way I want. The only thing I can’t figure out is that if I’m on my blog main page and click the drop down, I can’t choose the top category (Adventure).

    Instead I have to select any other category, and then choose the first one.

    Is there any way to add a dummy option to the top of the list?

    Like:

    subjectss

    Thanks,
    -Paul

  13. option value='' subjects /option

    Whoops.

  14. To be honest with you Paul, the dummy option is already added. You and I are using the same version of the plugin, but I have to tell you that although is working here I have seen that in other recent blog where I have added it is giving me the same problem than you (I think is with WP 2.1.3)

    As soon I have a chance to take a look I will let you know what is happening.

    ps: if you know html, try to open the plugin file and check that the empty option is over there.

  15. I’ve got ‘hide_empty’ => 1 in the plugin file default array. Thanks for the help!
    -PL

  16. Awesome. Thanks for this plugin!

  17. any plans to get this working w/ wordpress 2.2? I’m getting this error just like the first guy:

    Fatal error: Call to undefined function: get_categories()

    what is the equivalent to this command in wordpress 2.2?

  18. Hi, I love your plug-in, it works great!
    but i have a little problem, how can i make a empty default select ? the very first selection on my drop list is a category, because of that user can never select that category.
    On your page, you have the default selection set to an empty category.
    Can anyone teach me how to do it? Thank you

  19. Sorry guys,

    Apparently you were downloading the old version. Please try again and check if your previous bugs are gone.

  20. I followed the directions on this, up to the last line: “PASTE into your Code”…… WHERE?????

    I tried putting it at the top of the executable Code, refreshed… nothing…

    Any ideas?

  21. - Go to presentation > theme editor and open the file named sidebar.php – Look for the piece of code similar to this one “wp_list_categories()”
    - Comment that code, don’t delete it just in case.
    - Paste the new code right there in a way that fit with the rest of the file.

    That’s all that you need to do; I can’t give you more details because your sidebar.php file could be different to mine.

    Good luck

  22. Sweet blog. I never know what I am going to come across next. I think you should do more posting as you have some pretty intelligent stuff to say.

    I’ll be watching you.

  23. Yesenia Jiminez

    Nice blog. Can’t wait to start my own blog.

  24. Another Great wordpress post, I will bookmark this post in my Mixx account. Have a good evening.

Leave a Reply

* Required fields.