Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?

Never mind! I managed to come up with a solution. function insert_location(){ ob_start(); ?> <select name=”location” id=”location” class=”postform”> <?php $tax_terms = get_terms(‘location’, array(‘hide_empty’ => ‘0’)); foreach ( $tax_terms as $tax_term ): echo ‘<option value=”-1″>Select a Location</option><option class=”level-0″ value=”‘.get_term_link($tax_term).'”>’.$tax_term->name.'</option>’; endforeach; ?> </select> <script type=”text/javascript”> /* <![CDATA[ */ (function() { var dropdown = document.getElementById( “location” ); function … Read more

Front End Dropdown Showing All Custom Post Type ‘Agent’

try this: //first get all agents $agents = new WP_Query(array(‘post_type’ => ‘agent’, ‘posts_per_page’ => -1, ‘order’ => ‘ASC’, ‘orderby’ => ‘title’)); //then just print out the dropdown: if ($agents->have_posts()){ echo ‘<select id=”agent”>’; while ($agents->have_posts()){ $agents-the_post(); echo ‘<option value=”‘.get_permalink($post->ID).'”>’.get_the_title($post->ID).'</option>’; } ?> </select> <script type=”text/javascript”> <!– var dropdown = document.getElementById(“agent”); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value > … Read more

How to create Custom Taxonomy Search Drop Down for specific Post Type

First create a function to display your search form function display_custom_search_form($atts){ $return = ‘<form role=”search” method=”get” id=”searchform” action=”‘.home_url( “https://wordpress.stackexchange.com/” ).'”> <div><label class=”screen-reader-text” for=”s”>Search for:</label> ‘.wp_dropdown_categories(array(‘name’ =>’taxTerm’, ‘taxonomy’ => ‘TAXONOMY_NAME’).’ <!– this is the magic field you will need to change in order for this to work with each post types—> <input type=”hidden” name=”post_type” value=”post” /> … Read more

Exclude category from drop down list form

try: <?php $cat_to_EXCLUDE = 50; $cate_id = retrieve_cat_data(true); $cate_name = retrieve_cat_data(false); for ($i = 0; $i < count($cate_name); $i++ ) { ?> if ($cate_id[$i] != $cat_to_EXCLUDE){ <option value=”<?php echo $cate_id[$i]; ?>”><?php echo $cate_name[$i]; ?> </option><?php }} ?> update: if you search your theme’s functions.php file i bet you will find a function named retrieve_cat_data anyway … Read more

make a dropdown custom field with ‘cities’ list in it

You can register custom taxonomy like so: <?php // Register custom taxonomy for locations function mamaduka_register_taxonomy_location() { register_taxonomy( ‘location’, array( ‘post’ ), array( ‘hierarchical’ => true, ‘label’ => ‘Locations’, ‘public’ => true, )); } add_action( ‘init’, ‘mamaduka_register_taxonomy_location’ ); ?> for more information about custom taxonomy see Codex: http://codex.wordpress.org/Function_Reference/register_taxonomy

Help with a get_categories () drop down menu – I want it to show in heirachial form

wp_dropdown_categories has a hierarchical and depth options available. $args = array( ‘show_option_all’ => ‘All Tshirt Categories’, ‘orderby’ => ‘ID’, ‘order’ => ‘ASC’, ‘hide_empty’ => 1, ‘child_of’ => 0, ‘hierarchical’ => 1, ‘depth’ => 1, ‘taxonomy’ => ‘tshirt_categories’, ‘hide_if_empty’ => false ); ?> <h2>By Category</h2> <form action=”<?php bloginfo(‘url’); ?>” method=”get”> <div> <?php wp_dropdown_categories($args); ?> <input type=”submit” … Read more

working with result of wp_dropdown_pages()

Not sure what your trying to do with the custom field but you can create your own drop down select using the get_pages() function which returns an array of pages similar to the get_posts() function. $pages = get_pages(); foreach( $pages as $page ) { echo get_post_meta( $page->ID, ‘your_meta_key’, true ); }

Select Venue from dropdown list and reuse stored address information in meta_box

You’re already storing the venue, so you should be able to simply extract from an array front-side based on what a get_post_meta call returns. If i’m following you correctly still at this point, something along these lines should do the trick. function get_related_event_data( $venue, $field = ‘all’ ) { $event_data = array( ‘Spruce Gallery’ => … Read more

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