Tagged Questions
1
vote
2answers
50 views
wp_insert_post sometimes fails after API call
I have built a plugin that fires an Ajax call to connect to a third-party API. That API returns some Json, which I then save as a custom post with wp_insert_post.
Now, usually, this works. But, now ...
0
votes
1answer
25 views
Problem with a query in custom posts
I'm making a search form to select available rooms.
I have a custom post for the rooms called "Products" and a post meta value called "availability" (format: Y-m-d).
And I want to find all rooms ...
0
votes
1answer
26 views
Filtering problem
I got the custom_post_type_data in which I store some variables when I make a new post. Variables likes Author, Price etc.
I implemented a filtering by author, so when you click on James (for ...
0
votes
1answer
22 views
Assign a tag to custom post type using a query
I have a custom post type courses with a custom field level. I want to run a query (mysql or WP query) that runs through every course (post) and if the level is greater than 3, append a tag called ...
0
votes
1answer
138 views
SQL query - get ids - Advanced Custom Fields / WPeC
I need to query the database on add_action( 'init', '...') to find post ids with the field 'product_discount_option' set to true.
I know at least one of my product posts have the field ...
1
vote
2answers
156 views
$wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
It's easier if I made an example:
I have a custom post type MYPOSTTYPE, with 3 taxonomies TAX_1, TAX_2 and TAX_3
If I have 3 terms: 'TERM_TAX_1' in TAX_1, 'TERM_TAX_2' in TAX_2, and 'TERM_TAX_3' in ...
1
vote
1answer
199 views
How do I write this SQL statement for Posts written in last 24 hours?
Someone gave me this SQL code to count the number of posts (of post_type 'mixtapes') in the last 7 days. I tried to convert it to 'in the last 24 hours' as well, but it's giving the wrong number.
...
2
votes
2answers
540 views
modify all posts of a category to “no comments allowed”
I'm looking for a way to modify all posts of a certain category to be "no comments allowed" without going into each post settings, one by one, and modifying manually.
Perhaps a MySQL statement?
...
0
votes
2answers
158 views
Why doesnt my tag page populate with this custom post type?
I have a tag page that is generated with the first image attachments from all of the posts. I call it in the loop with :
<img src="<?php echo get_first_attachment() ?>" />
and this is ...
0
votes
2answers
961 views
Mass convert MySQL data entries into custom post type?
I have a MySQL table with about 500 rows of entries each containing: title, author, series, and series number.
Would anyone know how to mass convert the data into (1 entry per post) custom post type ...

