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

WooCommerce Bookings Plugin Not Saving Order ID

A minor update (I ran into this issue today): The above solution does not work anymore. The only thing you need to do nowadays is to set the post_parent: wp_update_post(array( ‘ID’ => $booking->id, ‘post_parent’ => $order->id ));

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

Problem with adding custom post type meta to header by plugin

It’s should be return rather than echo. return ‘<meta name=”site_title” content=”‘.’test test’.'”>’.”\n”;

Categories custom-post-types Tags custom-post-types, headers, plugin-development, post-meta

Is it possible to set a variable for get_post_meta?

In answer to my question (and in case anyone is interested), this seems to be the best solution: <?php $service_name = $post->_cmb2_service_name; ?> <p><?php echo $service_name; ?></p>

Categories theme-development Tags post-meta, theme-development

Automatic blog page with custom design [closed]

First check your template or source code to find the classes added to the article as a whole (or any html element that wraps around the whole post. It probably looks a bit like this: <article class=”my-article”> <title class=”my-title”>TITLE</title> <img src=”https://wordpress.stackexchange.com/questions/228934/…” class=”my-featured-image”/> <div class=”my-content”> POST TEXT </div> </article> Now, in your style.css file you must … Read more

Categories posts Tags blog-page, post-meta, posts

Cannot obtain custom meta information

I don’t know why you are using a custom template for displaying an individual Video post when there is a single file that is used for this purpose – single-{post_type}. https://codex.wordpress.org/Post_Type_Templates Using the single file, you will be able to get the post ID with $post->ID or get_the_ID(). if( have_posts() ) : while( have_posts() ) … Read more

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

Display posts with empty custom field

You probably need the NOT EXISTS meta_compare value. This will test if a meta value exists or not for that particular key. Also, as I pointed out in comments, caller_get_posts is long time deprecated, a notice you should have clearly recieved if you had debubbing turned on. The correct parameter is ignore_sticky_posts and accepts 0 … Read more

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

Update post meta – Custom field does not match meta-key

Arrays are serialized by default, so just do update_post_meta($my_post, ‘ganalytics_settings’, $ganalytics_settings); https://codex.wordpress.org/Function_Reference/update_post_meta $meta_value (mixed) (required) The new value of the custom field. A passed array will be serialized into a string.(this should be raw as opposed to sanitized for database queries) Default: None Also, make sure that $my_post is post ID, not the post object. … Read more

Categories PHP Tags advanced-custom-fields, php, post-meta

Can I save post meta programatically without setting metaboxes?

You should always use update_post_meta() function because if the term doesn’t exist it will make a call to the add_post_meta() automatically. The same goes for update_user_meta(). Example if you want to add the meta “City” but you don’t have it in the db you simply make a update_post_meta($city) and in $city you need the post_id … Read more

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

add_post_meta doesn’t work

you have pass static postID which is not match at your live server. Please check the ID of post. For good practice pass the dynamic ID as per documentation. <?php add_post_meta($post_id, $meta_key, $meta_value, $unique); ?> $post_id –> The ID of the post to which a custom field should be added. $meta_key –> The key of … Read more

Categories post-meta Tags post-meta

update_post_meta() adding bits in database [closed]

WP serialises the data for you into a single meta field. It’s serialised the data you had already serialised. You need to add the data in the form that you’d like it when you read it again.

Categories post-meta Tags post-meta
Older posts
Newer posts
← Previous Page1 … Page92 Page93 Page94 … 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