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

get_post_meta() returns nothing in save_post, publish_post, wp_after_insert_post

get_post_meta() returns nothing in save_post, publish_post, wp_after_insert_post

Categories post-meta Tags post-meta, save-post

How to show wordpress post in the site based on custom field value?

This worked for me as long as it’s run only on the appropriate query. The key is MySQL’s FIELD() function, which lets you specify an arbitrary ordering. add_action( ‘pre_get_posts’, ‘add_match_times_to_query’ ); function add_match_times_to_query( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( ‘meta_query’, array( ‘match_time’ => array( ‘key’ => ‘match_time’, ‘compare’ => ‘EXISTS’, … Read more

Categories post-meta Tags post-meta

Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key “filmmaker” more than once)

Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key “filmmaker” more than once)

Categories custom-field Tags custom-field, post-meta, wpdb

Save frontend submission form field as custom field

I you need to use update_post_meta($post_id,’your_meta_key’,’your_meta_value’); or you can save in new variable like $city_value = $_POST[‘city_field’]; then code will be update_post_meta($post_id,’city_field’,$city_value);

Categories post-meta Tags post-meta, save-post

What effect can a large wp_post table have on overall site performance?

What effect can a large wp_post table have on overall site performance?

Categories posts Tags database, performance, post-meta, posts

NewsPaper WP Theme – Additional Related Posts Filter by Time (divTag composer)

NewsPaper WP Theme – Additional Related Posts Filter by Time (divTag composer)

Categories posts Tags get-posts, post-meta, posts

WP_Query by meta key not returning any posts

A custom post_type is a type of post that has a unique name, like ‘event’ or ‘book’ depending on the type of object you are needing. This can be anything. The post_type ‘post’ is a built in WP post_type and concerns only blog posts in the “Posts” panel of the admin area. Add ‘post_type’ => … Read more

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

Updating order meta to have a meta entry from an item in the order

Updating order meta to have a meta entry from an item in the order

Categories woocommerce-offtopic Tags post-meta, woocommerce-offtopic

Check for custom field value in different post type than current one and do something

If I understood correctly, I believe this will help you to get what you’re after. I can’t verify it works, but reading it should give some guidance: function my_plugin_verify() { // ————————————————————————– // 1) I’m checking if the user is logged in if (!is_user_logged_in()) return false; // NOT VERIFIED // ————————————————————————– // 2) if he … Read more

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

Chance post id into post name

Does this meta field store some other post’s ID, of which you want to retrieve the post name? If so, try this <?php global $post; $customlink = get_post_meta( $post->ID, ‘clink’, true ); echo get_post_field( ‘post_name’, $customlink ); ?>

Categories post-meta Tags post-meta
Older posts
Newer posts
← Previous Page1 … Page6 Page7 Page8 … Page203 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