Skip to content

Armstrongest

Programming, Patterns, and Paradox

  • Code
  • Musings
  • Design
  • Contact

Tag: wordpress

How Get all WordPress posts that have a custom field

Posted on January 7, 2019 by Gary Armstrong
I need all the meta data from Commander Data

Sometimes, you just need to get a list of posts, that contain a specific piece of metadata and output them as a list. Instead of getting a list of each post and then looping over all the posts and checking for metadata, it’s a relatively simple SQL statement. If you had a list of product […]

Posted in Code, Snippets Tagged code, custom fields, get_post_meta, sql, wordpress Leave a comment

Reduce 101 MySQL database calls to just 2 (Part 1)

Posted on August 28, 2016April 29, 2017 by Gary Armstrong

If you’re using custom fields on a custom post type in WordPress. How do you show ALL instances of that custom field for multiple items? How about showing the custom field for ALL the items? There are two ways to do this.

Posted in Code, WordPress Tagged get_post_meta, sql, wordpress Leave a comment

Recent Articles

  • PHP 7 and the Null Coalescing Operator ?? April 27, 2019
  • How Get all WordPress posts that have a custom field January 7, 2019
  • How to get posts that do NOT have a custom field value December 13, 2018

Archives

  • April 2019 (1)
  • January 2019 (1)
  • December 2018 (1)
  • May 2017 (2)
  • April 2017 (2)
  • March 2017 (1)
  • February 2017 (1)
  • January 2017 (4)
  • October 2016 (1)
  • September 2016 (3)
  • August 2016 (1)

Categories

  • Code (17)
  • Design (1)
  • Lab (1)
  • Musings (7)
  • Snippets (1)
  • WordPress (9)
Proudly powered by WordPress | Theme: armstrongest by Gary Armstrong.