2
votes
2answers
77 views

Automatically adding meta data to posts or multiple query help

I run an events company whose website uses a custom post type system for posts (blog), events and tickets all stored as CPT's in the DB. On the guestlist (which counts 'ticket' custom posts if the ...
0
votes
1answer
28 views

Minimize database queries to user tables?

I'm trying to come up with a strategic way to collect large amounts of usermeta data (and output to the screen) while keeping database queries low. Some pages, like the home page, single pages, and ...
0
votes
0answers
31 views

Working with arrays/foreach statements - echo results? Addition operator w/foreach… multiplying?

I'm really struggling with this - I'm relatively new to PHP but I'm trying make this code that I've pulled together output a list of chapters sorted by user pageviews based on a user_meta field called ...
-3
votes
2answers
86 views

Query parsing only author ids

I need array only all author ids from the loop, each one only once if possible and out of all posts in the loop. Any suggestions?
0
votes
1answer
26 views

Using class id from array for query

I'm using Event Calendar 3. Since there seems to be no easy way of querying all upcoming events as posts, I tried it this way, getting the IDs from the DB and querying the posts from that: <?php ...
0
votes
0answers
72 views

Show posts using custom while loop with pagination

I have an array of post ids i would like to show in a page 16 at a time. The array may include some repeating ids that is why i could not use post__in in a custom wordpress query because some of the ...
1
vote
2answers
453 views

How to write: $wpdb->update having WHERE NOT value pair in the array

I need to update all meta keys in the postmeta table that have a value other than 0, to the value of 0. I tried this.. no love (though I cannot figure out why....): $status = $wpdb->query("UPDATE ...
0
votes
1answer
46 views

Adding Category Argument into an Array for WordPress Query

I'm new to customizing WordPress and am looking to query an array of posts within a certain category. I have a display that's showing an array of all posts from the site: $arguments = array( ...
0
votes
1answer
83 views

Exclude posts based on an array

I'm using a custom meta box to output a list of post IDs within a particular post type ("Publications" in this example). Is there a way I can output this array into a custom loop to only show posts ...
2
votes
3answers
995 views

Reversing the order of posts AFTER the query is performed

I'm am displaying the last 5 posts of a custom post type 'show'. This gives me the latest post first. <?php $args = array( 'post_type' => 'show', 'posts_per_page' => 5, 'order' ...
0
votes
2answers
504 views

Wordpress loop: Display <div> if posts exist

In a single post template I am trying to output some header text in a <div> and display links to related posts in a <ul> if related posts exist (based on tags). If there are no posts, ...
0
votes
1answer
572 views

How to include post count in this “get_tags” snippet

Can anyone tell me how I can show a post count in this code snippet? <?php $tags = get_tags(); if ($tags) { foreach ($tags as $tag) { echo '<li><a href="' . get_tag_link( ...