Add post type titles in customizer dropdown list

Ok I found it, here is the answer for next ones who are looking for the same thing: $cf7forms_list = array(); $args = array(‘post_type’ => ‘wpcf7_contact_form’); $cf7forms = get_posts( $args ); foreach($cf7forms as $cf7form) { $cf7forms_list[$cf7form->post_title] = $cf7form->post_title; } $wp_customize->add_setting( ‘contact_list_section’, array( ‘transport’ => ‘postMessage’ )); $wp_customize->add_control( ‘contact_list_section’, array( ‘label’ => esc_html__( ‘Contact form’, ‘mytheme’ … Read more

How to use an array of categories as a dropdown?

Try this, $categories_array = array(); $categories = get_categories(); foreach( $categories as $category ){ $categories_array[] = $category->term_id; } array( ‘param_name’ => ‘category_id’, ‘type’ => ‘dropdown’, ‘value’ => $categories_array, // here I’m stuck ‘heading’ => __(‘Category filter:’, ‘overmax’), ‘description’ => ”, ‘holder’ => ‘div’, ‘class’ => ” ),

Query posts from a child taxonomy term id

i solved the problem if(isset($_POST[‘main_brand_id’])) { $term_id .= $_POST[‘main_brand_id’]; $term = get_term( $term_id, ‘state’ ); $slug = $term->slug; global $post; $post_id = $post->ID; $args = array( ‘post_type’ =>’dealers’,’taxonomy’=>’state’, ‘term’ => $slug ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); echo ‘<option value=”‘.$post->ID.'”>’ $options .= the_title(); echo ‘</option>’; endforeach; die(); } … Read more

Dynamic dependent Dropdown lists for categories, sub-categories and posts

you may find your answer here and Here’s a demo of it. HTML code example <div class=”ccms_form_element cfdiv_custom” id=”style_container_div”> <label for=”brand”>Make:</label> <select size=”1″ id=”make” class=” validate[‘required’]” title=”” onChange=”updatepage();” type=”select” name=”style”> <option value=”-1″>–Choose a Make-</option> <option class=”Audio” value=”Audi”>Audi</option> <option class=”BMW” value=”BMW”>BMW</option> </select> <div class=”clear”></div><div id=”error-message-style”></div> <div id=”style-sub-1″ class=”BMW” style=”display: none;” name=”stylesub1″ onchange=”ChangeDropdowns(this.value)”> <label for=”brand”>Model:</label> <select name=”cat” … Read more

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