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

How to add/update post meta to use in query?

You can use this function, which you’d add to the theme’s functions.php file, to update the average post rating which is saved in a private meta named _avg_rating (but you can of course rename it) — private meta has their name starting with an underscore (_): function update_post_avg_rating( $comment_id, $post_id = 0 ) { if … Read more

Categories post-meta Tags comment-meta, post-meta, rating

Attachment metadata has value of ‘1’

Attachment metadata has value of ‘1’

Categories post-meta Tags attachments, core-modifications, media, post-meta, rest-api

Export media library with metadata and import into new blog

Export media library with metadata and import into new blog

Categories post-meta Tags media, media-library, post-meta

Using a comma instead of a pipe to separate metadata

The default way WordPress separates different types of meta data, such as in the post meta data, is using a pipe |. For example, Author Name | Date | Cat1, cat2, cat3 This isn’t correct. WordPress doesn’t have a default way that it displays this information. It’s entirely up to the theme developer. if you’d … Read more

Categories post-meta Tags post-meta

Display multiple meta_key/meta_values by single SQL query

Display multiple meta_key/meta_values by single SQL query

Categories post-meta Tags mysql, post-meta

Is it possible to pass an whole array using custom field in wordpress?

Is it possible to pass an whole array using custom field in wordpress?

Categories post-meta Tags post-meta

How can i show post views using specified post ID?

You can pass post id as argument in the views function. Please check following example. An optional argument is passed in the function. If nothing is passed, id is fetched from get_the_ID(). if ( !function_exists( ‘mvp_post_views’ ) ) { function mvp_post_views( $post_id = ” ){ if ( $post_id ) { $post_id = absint( $post_id ); … Read more

Categories post-meta Tags post-meta, views

Update post meta date always store 1970-01-07

With debugging enabled, you should have gotten the following message: Notice: A non well formed numeric value encountered This is because strtotime() expects an integer as its second argument. You could use it like so $date = date(‘Y-m-d’, strtotime(‘+1 week’, strtotime($lejar_datum))); or if you want to use the more modern approach with DateTime $dt = … Read more

Categories post-meta Tags date, post-meta

Get table parameter and save in meta value

Keep in mind that if you leave this on the init action, this will occur on every page load. If you only want this to occur once or during another action, you’ll need to change this. This will also timeout if you try to execute this on too many posts. function update_my_metadata() { $args = … Read more

Categories post-meta Tags post-meta, wpdb

Meta data being pulled from wp-login.php

Meta data being pulled from wp-login.php

Categories post-meta Tags post-meta, wp-login-form
Older posts
Newer posts
← Previous Page1 … Page12 Page13 Page14 … Page51 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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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