0
votes
0answers
31 views

Custom query not working in plugin admin page

I'm not sure what I am doing wrong, but I cannot use get_post, get_posts or WP_Query in my plugin admin page. I can use get_user_meta, and get_userdata, so I'm a bit confused as to why I cannot use ...
1
vote
1answer
52 views

Why does my widget break other widgets?

So this widget i created is killing all other widgets registered in the same sidebar. Meaning, nothing renders after this widget does. No other widget markup makes it to the DOM. After hours of hair ...
0
votes
4answers
1k views

how to return only custom fields using get_posts()

I'm trying to get only the fields that I need using the get_posts() function in Wordpress. I currently have the following code: $posts_args = array( 'orderby' => 'post_date', ...
2
votes
2answers
1k views

Why Does get_posts() Return an Empty Set?

I'm writing a custom plugin that is initialized at init. This plugin is trying to query for some custom post types already stored in the DB. Here's my code: $args = array() $myposts = get_posts( ...
1
vote
2answers
213 views

Ordering posts by metadata

In my plugin, I use these instructions to obtain a list of posts: $args = array( 'numberposts' => -1, 'offset' => 0, 'meta_query' => array( array( ...
0
votes
3answers
161 views

Delist entries in the_loop

I am trying to add a delisting feature to my WordPress network. Posts which are delisted would not appear in post lists, but would still be visible if accessed directly. I've written a plugin that ...
1
vote
2answers
851 views

How to get posts by content?

I found the following codes to get post details. However, it is not possible to get the posts by content. Does any one has any ideas? get_posts() //// get post //// $args = array( 'numberposts' ...
0
votes
1answer
66 views

How do I query posts and have their related taxonomies returned in the results?

I have created a custom post type that contains television channel data. Each channel has its own post. I have also created a custom taxonomy of channel groups. What I want to do is query all the data ...
1
vote
1answer
501 views

get post attachment using ajax

I'm developing a plugin and I'm trying to get the url's from a post's attachments with ajax. If the user is on a single.php page. After some seconds, I'm sending an Ajax request, getting all the ...
0
votes
1answer
1k views

What's wrong with this post__not_in argument?

In the script below, the post__not_in argument does not appear to be working unless I hardcode the post ids inside the array(). Anything stand out? If an item is in the category, but also in the ...