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 / update_post_meta array

You’re calling get_post_meta() in two different ways: the first, leaving $single unset (it defaults to false) will get you the full array of meta entries for the given key; the second, setting $single to true, will get only the first item with that key. What you want, I believe, is an array of user IDs … Read more

Categories post-meta Tags post-meta

Can’t translate the post meta data (Date) in another language

You don’t need to change any code. get_the_date without an argument will use the date_format option in your WordPress settings. The option F j, Y will substitute F as “September”, but if you have a translation of “September” it will be used. Comments have suggested the use of date_i18n. This is used automatically when you … Read more

Categories post-meta Tags localization, post-meta, translation

What action hook updates post meta?

wp_update_post isn’t used for updating custom fields (ie postmeta content) – you should use update_post_meta

Categories post-meta Tags post-meta, wp-update-post

How to store post meta in an array?

From codex: $meta_value (mixed) (required) The value of the custom field you will add. An array will be serialized into a string. Default: None So <?php add_post_meta(7, ‘fruit’, ‘banana’, ‘apple’, ‘tornado’, ‘bob saget’) To grab them you can also use http://codex.wordpress.org/Function_Reference/get_post_custom_values besides just get_post_meta.

Categories post-meta Tags array, post-meta

Can I safely delete a record, manually, in the wp postmeta table?

It’s unclear what the postmeta actually does so it could effect your website in any number of ways.At best it will just clear the field / option and the user will need to re-enter it for that specific page.At worst it could change a pages layout or orphan a media file in your media library … Read more

Categories post-meta Tags post-meta

delete value 0 in post meta [closed]

This question is off-topic because your is a simple PHP error, not related to WordPress. You are trying to check if a variable is empty using: if ( $meta != $empty ) { but this is not the right way, in fact this code compare the target variable $meta with another variable $empty that is … Read more

Categories post-meta Tags post-meta

get_post_meta – get a single value

If every meta value has the key f_name $meta = get_post_meta($post->ID, “company_wp_box_g”, true); echo $meta[‘fname’]; If you’re not sure of the contents & want to search for the first one available $name = false; $meta = get_post_meta($post->ID, “company_wp_box_g”, false); foreach($meta as $array) { if(isset($array[‘f_name’])) { $name = $array[‘f_name’]; break; } } echo $name;

Categories post-meta Tags post-meta

Why am I getting an infinite loop with have_posts?

Look at this answer: get custom post type by tag I believe you’d use $flagged_stores->the_post() inside while loop.

Categories post-meta Tags loop, post-meta, recursive

List posts under meta_value heading

You should use some of WordPress’s built in functions, there is even a new meta compare parameter. You can create, for example: $state = get_post_meta($post->ID, ‘meta_state’, true); //the meta value to compare $query = new WP_Query ( array( ‘meta_key’ => ‘project’, ‘meta_value’ => ‘$state’, ‘meta_compare’ => ‘<=’, ‘post_type’ => ‘projects’ ) ); //spit them out … Read more

Categories post-meta Tags list, post-meta

Clean up output added via wp_head()

You can remove some of the header stuff with the following. // remove unncessary header info function remove_header_info() { remove_action(‘wp_head’, ‘rsd_link’); remove_action(‘wp_head’, ‘wlwmanifest_link’); remove_action(‘wp_head’, ‘wp_generator’); remove_action(‘wp_head’, ‘start_post_rel_link’); remove_action(‘wp_head’, ‘index_rel_link’); remove_action(‘wp_head’, ‘adjacent_posts_rel_link’); } add_action(‘init’, ‘remove_header_info’); The default installation does not include stuff like meta keywords, so that is either a theme or plugin that you are … Read more

Categories post-meta Tags functions, headers, post-meta, seo
Older posts
Newer posts
← Previous Page1 … Page44 Page45 Page46 … 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