How to make checkboxes from taxonomy terms?

I can populate selectbox options like this: <?php $args = array( ‘taxonomy’ => array( ‘country’, ), ‘hide_empty’ => 0, ‘name’ => ‘country’ ); ?> <?php wp_dropdown_categories($args); ?> But the problem is how to make a checkbox list instead of a dropdown? I mean something like this: 1 Answer 1 $taxonomy = ‘training_cats’; $orderby = ‘name’; … Read more

wp_dropdown_pages default value

I have a dropdown menu of pages, but after I go to a page selected, let’s say “About us”, the default title button of dropbown is the title of the page, “About us”, so i want the title/default option to be “Please select a page” or something like that. My code is this: wp_dropdown_pages(“title_li=&depth=1&sort_column=menu_order&child_of=”.$post->post_parent.”&echo=0&selected=$currPage”); What … Read more

Best way to do nested case statement logic in SQL Server

I’m writing an SQL Query, where a few of the columns returned need to be calculated depending on quite a lot of conditions. I’m currently using nested case statements, but its getting messy. Is there a better (more organised and/or readable) way? (I am using Microsoft SQL Server, 2005) A simplified example: SELECT col1, col2, … Read more

Style the last element having a specific class [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 5 … Read more

How to get a list of taxonomy terms which are being used only within certain post types?

I have a custom taxonomy called ‘locations’ which is being shared across a bunch of post types. I want to make a select field dropdown list of my locations (terms) to let users go to the taxonomy term page for each specific location; however I want to exclude some terms which are used in one … Read more

Populating dropdown menu with hierarchical taxonomies

Im currently populating my <select> elements (I’ve got plenty of them) with nested foreach loops, get_terms() and &nbsp;&nbsp;&nbsp;&nbsp; to create padding for each nested child element. Each <select> code is about 50 lines long and is looking very dirty – I always have to take few minutes to understand what’s going on before changing anything. … Read more

How to replace a javascript select box onchange event to a form submit action?

I have a small problem that probably has a very simple fix. I have been using the wp_get_archives() function to produce a dropdown select form. See the full code below: <form id=”side-arch”> <select name=”archive-dropdown” onchange=”document.location.href=this.options[this.selectedIndex].value;”> <option value=””><?php echo esc_attr( __( ‘Select Month’ ) ); ?></option> <?php wp_get_archives( array( ‘type’ => ‘monthly’, ‘format’ => ‘option’, ‘show_post_count’ … Read more

Select dropdown not showing selected value php

I’m using WordPress Settings API. Everything works as it should except this select dropdown. When I select an option, the value echoed is correct but in the dropdown it displays the default first value i.e 6 and not the selected one. Where am I going wrong? public function someplugin_select() { $options = get_option( ‘plugin_252calc’); echo … Read more