Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

post-meta

Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)

You can use meta_query parameter (and Query all posts where a meta key does not exist) to limit the query to only posts that have or don’t have a certain meta value. $query = new WP_Query(array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => ‘your_meta_key’, ‘compare’ => ‘NOT … Read more

Categories plugins Tags custom-field, php, plugins, post-meta

changing meta value and meta key of price field

changing meta value and meta key of price field

Categories custom-post-types Tags custom-post-types, customization, post-meta, woocommerce-offtopic

Limit the number of acf content when displaying in post loop [closed]

Limit the number of acf content when displaying in post loop [closed]

Categories custom-field Tags custom-field, loop, pagination, post-meta

WordPress Rest API to call page data associate with custom meta

WordPress Rest API to call page data associate with custom meta

Categories custom-field Tags custom-field, post-meta, rest-api

Plugin with action ‘save_post’ needs to press publish twice on order to publish

Plugin with action ‘save_post’ needs to press publish twice on order to publish

Categories plugin-development Tags actions, plugin-development, post-meta, save-post

How do I create an archive page as a including metadata?

How do I create an archive page as a including metadata?

Categories custom-post-types Tags custom-post-types, meta-value, post-meta

Using hook to use DISTINCT in a wp_query

Using hook to use DISTINCT in a wp_query

Categories wp-query Tags mysql, post-meta, wp-query

Routine to convert custom post meta from old to new value

You can run the following sql queries: update wp_postmeta set meta_key=replace(meta_key,’MyCustomHeader’,’_MyCustomHeader’) where meta_key like “MyCustomHeader”; update wp_postmeta set meta_key=replace(meta_key,’MyCustomTitle’,’_MyCustomTitle’) where meta_key like “MyCustomTitle”;

Categories Database Tags database, post-meta

How to find time last viewed?

Post views log/count is not available natively. It is resource-intensive (database writes are much more expensive than reads) and won’t work (if done in pure PHP) with most caching plugins. There is number of plugins/services that offers Analytics via JS- or image-based tracking. Your best bet is to let such service handle analytics and pull … Read more

Categories cache Tags cache, post-meta, timestamp, views

meta_compare seems to be treating values as strings instead of integers as expected

See this question and my answer there query_posts ->using meta_compare / where meta value is smaller or greater or equals… Basically for the purpose of meta comparison value is always treated as string, because it is passed as such to $wpdb->prepare() method.

Categories custom-field Tags custom-field, post-meta, query-posts
Older posts
Newer posts
← Previous Page1 … Page138 Page139 Page140 … Page204 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress