Tagged: dropdown, menu, taxonomies
- This topic has 5 replies, 2 voices, and was last updated 6 years, 2 months ago by
Steve.
-
AuthorPosts
-
-
November 18, 2015 at 5:42 pm #5032
bicho44MemberHi again:
I made the change in my other ticket and is almost ok.
I need the dropdown jump to the taxonomy URL like demo.com/product/[taxonomy-name], but its seems i cannot make the function work.
There’s a WP function who have an example to make this, but do not respect my url settings (use the /?cat=xxx)
Any idea?
Thanks in advance.
-
November 19, 2015 at 12:35 pm #5040
SteveKeymasterSo you’re not using pretty permalinks? You’re using query parameters? What’s your settings in SETTINGS > PERMALINKS?
-
November 19, 2015 at 2:27 pm #5043
bicho44MemberOf course im using pretty permalinks 😀
But, the form with get, do not use it, i was trying to change that, and then i give u and ask for help 😀
This is my front end code, right now (im not using piklist here, because it wasn’t working)
Also i need the form tag. is my second try 😀if ($categoria) { // piklist::pre($categoria); $catname= strtolower($categoria->labels->name) ?> <form id="<?php echo $catname; ?>-select" class="<?php echo $catname; ?>-select" action="<?php echo esc_url( home_url( '/productos/') ); ?>" method="get"> <?php $args = array( 'show_option_none' => __( 'Seleccione para Buscar', 'imgd' ), 'show_count' => 0, 'orderby' => 'name', 'name' => $catname, 'echo' => 0, 'value_field' => 'slug', 'taxonomy' => $categoria->name, ); ?> <?php $select = wp_dropdown_categories( $args ); ?> <?php $replace = "<select$1 onchange='return this.form.submit()'>"; ?> <?php $select = preg_replace( '#<select([^>]*)>#', $replace, $select ); ?> <h4><?php echo $categoria->labels->name; ?> de Productos</h4> <?php echo $select; ?> <noscript> <input type="submit" value="Buscar" class="btn btn-success"/> </noscript> </form> <?php } ?>The form send a get request, and because of the `’return this.form.submit()’ send the ‘name’ arg as variable with the ‘slug’ as value to search.
As i said i need to send a get request with the form of the taxonomies Ex: /productos/linea/Gastroenterología but i dont know how.
Also i wanna use the piklist way, but the dropdown in the widget, dont have the form tag,
PS: I have 3 dropdowns in the widget at the same time, each for every kind of taxonomy.Attachments:
You must be logged in to view attached files. -
November 20, 2015 at 11:55 am #5049
SteveKeymasterSorry, I’m a bit confused. Does it work this way, but not with Piklist? Or it doesn’t work either way?
-
November 20, 2015 at 5:23 pm #5051
bicho44MemberIts dosent work either way…
Sorry if i wasnt clear.
Thanks in adavnce, im still trying
-
November 23, 2015 at 11:58 am #5067
SteveKeymasterGet it working the way you want with standard HTML, and then we’ll make it work with Piklist.
-
-
AuthorPosts
- You must be logged in to reply to this topic.