Mango123
Forum Replies Created
-
Thanks so much @berksted for getting back to me so quickly. I installed Query Monitor and realised I had added a hook for choosing a specific template based on the post id that I had forgotten about. This was preventing the correct temaplate from being used.
Thanks again!
Thanks sjmcdonald for your response. I tried the “Add Media” button but this only seems to allow me to insert images into the body field of the gallery, or set a featured image. I want to be able to add images to the images section of the gallery post.
The gallery post was a custom content type created by the gallery plug in I’m using. You can see a screenshot of it here.
Forum: Fixing WordPress
In reply to: How to use custom object field value as parameter in query_postsHi vtxyzzy,
Thanks for your question, I wanted to filter query_posts so it would only return results based on a custom field value.
I managed to find out that I could use the object ID of the custom field. So for ‘meta_value’ I could use the value found from $field->ID.
The code I ended up using was:
wp_reset_query(); $args = array( 'post_type' => 'feature', 'orderby' => 'date', 'order' => 'ASC', 'posts_per_page' => 4, 'meta_key' => 'on_page', 'meta_value' => 2 ); query_posts( $args );The meta_value I found by printing $field->ID.