Query post created by mediapress
-
Hello, I would like to query post created by mediapress. (The upload attachment pages) The problem is wordpress doesn’t treat them as regular post and therefore I do not know the “post_type” or if it’s a post type at all.
What I want to do with this info is track the likes of uploaded images. I am using the setup found here: https://buddydev.com/mediapress-development/mediapress-like-unlike-button-for-photos-videos-etc-with-wp-ulike-plugin/
Everything works fine as far as being liked and within WP Ulike statistics I can see the post-id of the uploads that receive likes. That tells me that some type of post is generated when things are uploaded.
I want ot use code like this one:
<?php $args = array( 'monthnum' => 4, 'meta_key' => '_liked', 'orderby' => 'meta_value_num', ); $post_query = new WP_Query($args); if($post_query->have_posts() ) { while($post_query->have_posts() ) { $post_query->the_post(); ?> <h2><?php the_title(); ?></h2> <?php } } ?>
This code shows the top post for the previous month. The above code works fine for regular post but I would like to know how I would set that up to query the attachment post made by mediapress. (specifically photos) Is that possible?
- The topic ‘Query post created by mediapress’ is closed to new replies.