How to use wp_category_checklist()?

Here is the answer I ended up with: $select_cats = wp_dropdown_categories( array( ‘echo’ => 0 ) ); $select_cats = str_replace( “name=”cat” id=”, “name=”cat[]” multiple=”multiple” id=”, $select_cats ); echo $select_cats; It displays a list of my categories that can be multi-selected as per my question. It’s a hack of wp_dropdown_categories, but it works.

get_pages Drop down list for selection of a page

You already have <option value=””>…</option> you just need some extra attrs for it You need to load current value and if value equals $page->ID than add attr selected=”selected” Here’s how it could be done: <select name=”easyreg_redirect_page”> <option selected=”selected” disabled=”disabled” value=””><?php echo esc_attr( __( ‘Select page’ ) ); ?></option> <?php $selected_page = get_option( ‘option_key’ ); $pages … Read more

Recreating the hierarchy of taxonomies for a dropdown form menu?

You can use the standard WordPress function, get the dropdown already formatted and solve both problems at once. Like so: define( ‘WP_USE_THEMES’, false ); require( ‘./wp-load.php’ ); wp_dropdown_categories( array( ‘child_of’ => 0, ‘class’ => ‘postform’, ‘depth’ => 0, ‘echo’ => 1, ‘exclude’ => ”, ‘hide_empty’ => false, ‘hide_if_empty’ => false, ‘hierarchical’ => true, ‘id’ => … Read more

How to number the options in a wp_dropdown_pages() select?

To change <option value=”http://someurl”>item one</option> <option value=”http://someurl”>item two</option> <option value=”http://someurl”>item three</option> to <option value=”http://someurl”>1. item one</option> <option value=”http://someurl”>2. item two</option> <option value=”http://someurl”>3. item three</option> we can utilize the list_pages filter from the Walker_PageDropdown::start_el() method. Here’s an example: // Add filter add_filter( ‘list_pages’, ‘wpse_itemize’, 10, 2 ); // Display dropdown wp_dropdown_pages(); // Remove filter remove_filter( ‘list_pages’, … Read more

Help with multiple dropdown tags search

Does your theme have a search.php to display the results? And if not then create one based on the codex examples or default theme or post the source to your index.php for troubleshooting. Edit: Your search.php is difficult to debug, try following the structure of a default theme, and put something like this in your … Read more

Get data from dropdown and update page

How about this: <?php $arr = [“Cat”, “Dog”, “Cow” ]; if( $_POST[‘animal’]){ $animal=$_POST[‘animal’]; echo $animal; } ?> <form name=”f” id=”a” method=”post” action=””> <select id=”animal” name=”animal” onchange=”this.form.submit()” > <option value=”0″>–Select Animal–</option> <?php foreach ($arr as $a){ if($a == $animal){ echo “<option value=”{$a}” selected >$a</option>”; }else{ echo “<option value=”{$a}” >$a</option>”; } } ?> </select> </form> Note you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)