Categorías sin botón de envio
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”:
- 0 = No usar onchange()
- 1 = Usar onchange()
Instalación y configuración
- Descarga altrugon_dropdown_categories.zip
- Descromprime el fichero
- Copia la carpeta altrugon_dropdown_categories en tu directorio wp-content/plugins
- Activa el plugin
- Pega esta linea en tu código: <?php altrugon_dropdown_categories(’onchange_submit=1′); ?>
- 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.
Home
abril 2nd, 2007 at 21:19
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
abril 2nd, 2007 at 23:56
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!
abril 3rd, 2007 at 09:24
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.
abril 3rd, 2007 at 09:26
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?.
abril 22nd, 2007 at 02:40
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.
abril 24th, 2007 at 02:22
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?
abril 24th, 2007 at 18:59
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.
abril 25th, 2007 at 11:24
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.
abril 25th, 2007 at 11:31
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?
abril 25th, 2007 at 20:13
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.
abril 26th, 2007 at 10:45
Works great, thanks!!
mayo 2nd, 2007 at 21:08
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
mayo 2nd, 2007 at 21:09
option value='' subjects /optionWhoops.
mayo 2nd, 2007 at 22:30
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.
mayo 3rd, 2007 at 15:43
I’ve got ‘hide_empty’ => 1 in the plugin file default array. Thanks for the help!
-PL
agosto 29th, 2007 at 07:16
Awesome. Thanks for this plugin!
septiembre 27th, 2007 at 04:00
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?
octubre 5th, 2007 at 23:30
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
octubre 10th, 2007 at 23:10
Sorry guys,
Apparently you were downloading the old version. Please try again and check if your previous bugs are gone.
diciembre 5th, 2007 at 10:05
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?
diciembre 5th, 2007 at 20:28
- 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
junio 3rd, 2009 at 18:15
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.
junio 11th, 2010 at 08:08
Nice blog. Can’t wait to start my own blog.
junio 13th, 2010 at 23:46
Another Great wordpress post, I will bookmark this post in my Mixx account. Have a good evening.