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 remove Date from Meta Description on SERP?

If anyone else encounters this, check your source code and try and find the date in question to see where it’s being inputted, Googlebot normally finds these dates there. It turned out the Googlebot was picking up a date in the footer of my site, via the WordPress Latest Posts Widget, where I had selected … Read more

Categories post-meta Tags date, genesis-theme-framework, plugin-wp-seo-yoast, post-meta, seo

Custom meta is not being saved

add_action( ‘save_post’, array( $this, ‘save_metabox’, 10, 2 ) ); should be add_action( ‘save_post’, array( $this, ‘save_metabox’ ), 10, 2 ); If you enable debugging, you’ll see a call_user_func_array error generated by this. Also, a few other things- You should check if $_POST[‘anotai_nonce’] is set before trying to use it in assignment on the first line … Read more

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

Problem with saving large amount of data in postmeta/usermeta

The meta_value field is longtext, which a quick google reports is 4,294,967,295 characters – I doubt you’re exceeding that. Chances are it’s an issue with PHP, specifically post_max_size – if this is less than the “huge amount of data” you are referring to, PHP will simply truncate $_POST and you end up with nothing.

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

Get all terms linked to a post and include those who not connected from get_terms and sort

You just need to get the term id’s of the terms assigned to a post, and then exclude those terms from get_terms() You can try the following (Just note, the syntax for get_terms() changed in v4.5, I’ll be using the new syntax) $args = []; $taxonomy = ‘my_tax’; $post_terms = get_the_terms( get_the_ID(), $taxonomy ); // … Read more

Categories terms Tags post-meta, terms

Querying Database with wpdb

I tested your all attempts in a shortcode: function add_test_shortcode() { global $wpdb; global $post; $post_ID = $post->ID; $wpdb->show_errors = true; $result = $wpdb->get_var(‘SELECT meta_value FROM ‘.$wpdb->postmeta.’ WHERE meta_key=”my_test” AND post_id=’ . $post_ID); return $result; } add_shortcode( ‘test’, ‘add_test_shortcode’ ); It worked perfectly for me, so there might something from your own code: 1. Check … Read more

Categories PHP Tags php, post-meta, wpdb

Reset/delete post views meta/custom field after X hours or minutes or seconds

Your code for scheduling event isn’t correct, here is the correct one: function hits_set_zero_schedule() { if ( ! wp_next_scheduled( ‘hits_set_to_zero’) ) wp_schedule_event( time(), ‘daily’, ‘hits_set_zero’ ); } add_action( ‘wp’, ‘hits_set_zero_schedule’ ); function hits_set_zero_func() { delete_post_meta( $post_id, ‘post_views_count’, true ); } add_action( ‘hits_set_zero’, ‘hits_set_zero_func’ ); Also, you can define intervals otherwise than daily by adding a … Read more

Categories post-meta Tags post-meta, wp-cron

create custom meta box with default value

Yea. It seems everything is right. But I would prefer- if (empty($layout)) { $layout = “layout_1”; } instead of this- if ($layout == “”) { $layout = “layout_1”; } It’s the preferred method to test if the variable is empty or not. And I would also prefer- if ($layout === “layout_1” ) echo “checked” if … Read more

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

WordPress query posts with multiple post_meta data

It’s not a normal practice to use raw SQL in WP, unless you absolutely have to. You should be using normal WP APIs for this and optimizing after you encounter a performance issue. Among other things APIs will transparently cache data (such as post meta) within page load and between page loads with Object Cache … Read more

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

How to show specific post meta?

Try echo get_post_meta($home_starting_player, $pb_squad_number, true); The code you have returns an array; the third parameter specifies a single value.

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

Output meta into arrays

Add ‘fields’ => ‘ids’ to skip setting up the post and just create the array you want in the foreach. $week_args = array( ‘posts_per_page’ => – 1, ‘post_type’ => ‘post’, ‘post_status’ => array( ‘publish’ ), ‘fields’ => ‘ids’, ‘date_query’ => array( ‘before’ => ‘next Saturday’, ‘after’ => ‘last Monday’, ), ); $week_array = get_posts( $week_args … Read more

Categories loop Tags array, get-posts, loop, php, post-meta
Older posts
Newer posts
← Previous Page1 … Page111 Page112 Page113 … 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