Searching with Multiple (Parallel) Criteria on Custom Fields?

have a look at WP_Query(); and use meta_query / tax_query arguments $args = array( ‘post_type’ => ‘product’, ‘meta_query’ => array( array( ‘key’ => ‘color’, ‘value’ => ‘blue’, ‘compare’ => ‘NOT LIKE’ ), array( ‘key’ => ‘price’, ‘value’ => array( 20, 100 ), ‘type’ => ‘numeric’, ‘compare’ => ‘BETWEEN’ ) ) ); $query = new WP_Query( … Read more

Display content between two dates?

<?php <br /> function filter_where($where=””) {<br/> $where .= ” AND post_date >= ‘1980-05-11’ AND post_date <= ‘2011-05-11′”;<br/ > return $where;</br> }<br/> add_filter(‘posts_where’, ‘filter_where’);<br/> query_posts($query_string);<br/> while (have_posts()) :<br/> the_post();<br/> the_content();<br/> endwhile;<br/> ?> get meta data value and replace with the numeric date.

How to update custom field of a posts in a particular category

Use get_posts to get all the posts in this category, then loop over it and update the post meta for every post. <?php //get_posts uses same parameters as WP_Query hence using ‘category_name’ $tut_posts = get_posts(array(‘category_name’=>’tution’, ‘post_status’=>’publish’)); $url = //some youtube video url here if(!empty($tut_posts)){ foreach($tut_posts as $tut_post){ update_post_meta($tut_post->ID, ‘video’, $url); } } Please check if … Read more

Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]

Why use gravity post if you just want to do post add/insert + post_meta (assume on front-end), we can do it as long as we give a registered user certain capabilities. We can achieved this by creating custom role for user to add to specific custom post type, . For email notification you can use … Read more

use custom field value as post category in loop

Nevermind. Got it working with: <?php global $wp_query; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $store_name = (get_post_meta($post->ID, ‘store_name’, true)); query_posts(array(‘posts_per_page’ => ’10’,’paged’=>$paged,’category_name’=>$store_name)); ?>

Custom fields won’t update

‘name’ is what gets saved as key in the post meta data, so do a str_replace for the category name, before saving: // Wrong: name=”My Category” echo ‘<input type=”checkbox”‘ . $i . ‘name=”.””‘.$category->name.'”‘.’value=”” />’.$category->name; // Right: name=”my_category” $name = str_replace( ‘ ‘, ‘_’, strtolower( $category->name ) ); $checked = get_post_meta( …etc… ); echo “<input type=”checkbox”{$i} … Read more

Displaying custom field meta within WP_query loop

Your query should work if you call global $post and don’t reset the query (not needed when using WP_Query). You can also try using tax_query. $tax = ‘issue’; $terms = get_terms( $tax ); foreach ( $terms as $term ) : echo $term->name; $args = array( ‘post_type’ => $post_type, ‘post_per_page’ => -1, ‘post_status’ => ‘publish’, ‘caller_get_posts’ … Read more