Displaying and searching Custom Posts
Displaying and searching Custom Posts
Displaying and searching Custom Posts
I’m not sure why you are comparing anything when you would normally just query a meta_key for a certain day, maybe I mis-understood the question. The structure would be something like: meta_key => day // or $variable meta_value => Monday //for example Then you just query posts for a particular day which has a meta … Read more
Try WP_Query to get the posts, since get_posts() also makes use of it: $args = array( ‘category_name’ => ‘product-videos’, ‘posts_per_page’ => 5000, // or -1 if you want all ‘offset’ => 1 ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ): $the_query->the_post(); ?> <option value=”<?php the_ID(); ?>” <?php … Read more
Updating Other User’s Metadata
How to link keywords in custom fields?
[SOLVED] This do the Job: function set_the_terms_in_order ( $terms, $id, $taxonomy ) { $terms = wp_cache_get( $id, “{$taxonomy}_relationships_sorted” ); if ( false === $terms ) { $terms = wp_get_object_terms( $id, $taxonomy, array( ‘orderby’ => ‘term_order’ ) ); wp_cache_add($id, $terms, $taxonomy . ‘_relationships_sorted’); } return $terms; } add_filter( ‘get_the_terms’, ‘set_the_terms_in_order’ , 10, 4 ); function do_the_terms_in_order … Read more
If you want to make it as easy as possible on the user, then I think the best option would be to add a custom meta box with three fields for inputting the day/hour/minute values. Using something like a jQuery UI slider style timepicker would further simplify input. Then when the post is saved, use … Read more
reading the code of the Facebook Official Plugin I’ve seen that in open-graph-protocol.php It’s being applied the custom filter ‘fb_meta_tags’: .. $meta_tags = apply_filters( ‘fb_meta_tags’, $meta_tags, $post ); .. So in my plugin I’ve added a filter for ‘fb_meta_tags’ that adds/replace the image set from the Facebook plugin in this way: function clancat_product_fbmeta($meta_tags, $post){ .. … Read more
Catchable fatal error: Object of class stdClass could not be converted to string in /wp-content/themes/new/single.php on line 22 This is because $wpdb->get_row returns an object by default and you can’t echo an object. Changing echo $toc to echo $toc->meta_value will give you your desired result. Your other problem is that multiple terms can have have … Read more
This should work, but I didn’t have the time to test it. $query = new WP_Query( array( ‘meta_key’ => ‘_hit-counter’, ‘meta_value’ => ‘1000’, ‘meta_compare’ => ‘>=’, ‘orderby’ => ‘date’ ) );