Linked Questions

0 votes
1 answer
425 views

WP_Query count of different meta key values [duplicate]

I need to get count of different values of meta_key: Let's say I've got meta_key $class & there's only three different values: 1, 2 & 3. //My WP_Query $ads = new WP_Query(array( '...
N00b's user avatar
  • 2,179
24 votes
10 answers
94k views

Display featured products through custom loop in woocommerce on template page

I would like to display 6 featured products from my woocommerce store on my home-page.php template. After some researched I found that the right way to do this was through a custom loop,( I do not ...
steamfunk's user avatar
  • 645
1 vote
2 answers
10k views

How to get a meta value from all post

I searched for a while but I didn't find any solution. I used the functions listed here. It outputs something like this: Array ( [0] => 15 [1] => 30 [2] => 50 ) But I want ...
jepser's user avatar
  • 453
1 vote
2 answers
28k views

get_post_meta just returns Array

Here's what I am trying to do: I am trying to get one page in wordpress to pull data from custom fields in other pages. So that when a user creates a page and uses a particular custom field (in this ...
ultraloveninja's user avatar
1 vote
3 answers
7k views

How to Modify this $wpdb query to accept an array of post statuses

I'm using this function from this accepted answer, which gets all values for a custom field key (cross-post). How could it be modified to allow an array of post statuses? function get_meta_values( $...
Andrew's user avatar
  • 1,163
1 vote
1 answer
7k views

Get data from database using $WPDB

I'm missing something here. I simply want to get data from my database. So I tried this but keeps giving me an error. global $wpdb; $sql = "SELECT * FROM $wpdb->postmeta WHERE group='$group'"; $...
Interactive's user avatar
  • 1,006
4 votes
2 answers
2k views

How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?

I know the question is quite ambiguous. Let me explain: I have a page that lists all posts with a certain value of a custom field. (Eg.: The page Rentals lists all posts with the value rental of ...
rereradu's user avatar
  • 281
0 votes
1 answer
2k views

get_post_meta of multiple posts?

I'm trying to get the key values for multiple posts with get_post_meta but am having no luck so far. In short, I have a function that adds 'votes' and 'thevoters' to each post. I want to check to make ...
Carson's user avatar
  • 331
2 votes
1 answer
1k views

WP_Query meta_query results date by date

Don't leave! This isn't another question about how to orderby meta_value! I have a post type called events, and each post I create has a meta field I imaginatively called event_dates_wp which accepts ...
PUncle's user avatar
  • 75
1 vote
1 answer
212 views

Sorting posts by season

What would be the best way to go about creating something like this (https://www.fiawtcc.com/calendar/) in WordPress? This is a calendar, with posts (containing the event date and event description), ...
user avatar
0 votes
1 answer
323 views

Get all user meta_keys and then group users by matching values

One of the plugins I am using generates user meta from our AD. One of the keys is the user's Manager. As many users will have the same manager, I want to be able to group all users. I was trying to ...
markb's user avatar
  • 299
2 votes
1 answer
156 views

little help with a mySQL query to wp database

@t31os gave a very helpful response to: getting all values for a custom field key (cross-post) by providing this function if ( ! function_exists( 'get_meta_values' ) ) { function get_meta_values( $...
Ronnieinspain's user avatar
1 vote
1 answer
56 views

Add New Sub Site from the WordPress back end then in sub site options table option_value must be with https

I installed multi site setup for the domain https://uninfo.org but when i add new sub site from the back end it is creating but in sub site WP-options table it created with HTTP rather then https ...
Vijay Chauhan's user avatar