Tagged Questions
4
votes
1answer
111 views
How can I save an array from a random post sequence for later use?
I'm building a random workout generator on Wordpress to help with my fitness, and am stuck at saving random post arrays for later reference.
I'll explain.
The generator should work in two main ...
0
votes
1answer
121 views
Using multiple variables to assign categories to an array
I have php set up in a template file to check a form and see if 1 or more of 5 categories is selected. Based on which one is selected, I want the custom query I'm using to change in that the array for ...
1
vote
1answer
409 views
Can I query custom meta data through WP_Query
Ok, my question is a bit complex so I will try and give a general explanation and then go into details afterward.
I am running WordPress 3.4.2 and I am using WCK Post Type Creator and WCK Custom ...
0
votes
2answers
480 views
meta_query with array as value
I am writing some php which allows users of my site to submit a form and query posts by their post_meta. Everything works fine except for one thing, I used advanced custom fields to create the ...
0
votes
1answer
397 views
Removing duplicate values between two wordpress queries
I'm addressing a well known issue in Wordpress, in which I want to display "featured" posts, and under it the rest of the posts.
I have a $query1 which holds 2 featured posts, and my query_posts which ...
0
votes
1answer
78 views
meta_query returning excluded result
I have a series of day slots per location, in a multicheckbox custom field. I have a search page where the user can select location, weekday desired, and activity type. Right now I just have 2 ...
0
votes
2answers
190 views
WP Query Returning All Posts
I have a custom WP query that is returning every post, instead of just the ones being specified by the query. I can't seem to find anything wrong with the code, so I must be missing something:
...
0
votes
1answer
40 views
WordPress Query Returning Every Post
I have a custom WP query that searches a single custom field, using an array.
The custom field is for the country of origin of a post. The array I'm using are the names of the various countries in a ...
0
votes
3answers
74 views
Creating Custom Query
I've hit some sort of stumbling bock here, and I can't find my way over it.
I'm trying to craft a custom WP query that searches for posts by country of origin, selecting multiple countries at once.
...
-1
votes
1answer
370 views
PHP array external variable? [closed]
Trying to get an external variable ($var) from another php file into an array
list.php contains:
$var = "'Green', 'Blue', 'Red'";
This is the code:
<?php
flush();
ob_start();
...
0
votes
1answer
104 views
Inefficient Query Confusion
Edit #3 - meta_keys as an array
This seems to compare more than just the "opening_time" I can set the opening time for the wrong date or even leave it blank and it will still grab a post if the ...
0
votes
1answer
288 views
Use premade array as categories in wp_query?
I have a theme options panel that the user can set which categories they want to use which is then saved as an array $blog_cat[0] etc. They can select as many categories as they want for the array ...
0
votes
1answer
357 views
search serialised meta_value for date value?
i've saved and array of 'open days' as a serialised array in a meta value.
I was hoping i could then just search this field for the selected dates but i can't seem to create a match.
serialised = ...
2
votes
2answers
2k views
What kind of object type is WP_Query?
I am getting this error when I try to return the post_title value from my WP_Query:
**Fatal error:** Cannot use object of type WP_Query as array
Here is the code:
$query = new WP_Query( array( ...