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

post_title in save_post action

Without knowing the surrounding code, it is hard to tell what the problem might be, but you said you checked the $post variable. Maybe the $post variable is not set properly, the save_post action only gives you the post id: function get_post_title($post_id) { $post = get_post($post_id); if (empty($post->post_title)) { // No title set, put in … Read more

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

Hide the_meta if no value

You can check if there is any meta for the current post by using get_post_meta So to hide/show the div you would wrap your code in an if statement like this… <?php if( get_post_meta(get_the_ID()) ) { ?> <div> <?php the_meta(); ?> </div> <?php } ?>

Categories post-meta Tags post-meta

Add custom class to existing menu items from custom meta

I’ve got the filter just for you: nav_menu_css_class function wpse_175057_nav_menu_css_class( $classes, $item ) { if ( $item->type === ‘post_type’ && $class = get_post_meta( $item->object_id, ‘_icon’, true ) ) $classes[] = $class; return $classes; } add_filter( ‘nav_menu_css_class’, ‘wpse_175057_nav_menu_css_class’, 10, 2 );

Categories posts Tags menus, pages, post-meta, posts, walker

Looking for suggestions on creating simple database (Help!!)

First thoughts – a custom tax for actors might work. The Taxonomy Images plugin will make adding the headshot easy. I’d maybe make the production a post – or an instance of a CPT – I wouldn’t mess around with CSVs at all. You’d build the table in the post. I would perhaps create a … Read more

Categories custom-taxonomy Tags custom-taxonomy, database, metabox, post-meta, taxonomy

Edit post meta direct from post.php?

So awkwardly realised I’d been going about this whole thing in a stupid roundabout way and in fact Milo above in the comments is completely right, and proves that the codex still has secrets for everyone, or maybe just me. The eureka (or durr-eka) moment came after reading this post here about setting up and … Read more

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

Advanced Custom Field — grabbing post_meta from previous post

While fetching the custom fields details added using ACF, you need to use the functions from the plugin. Use the_field to echo the value and get_field to retrieve the value. Here you can use <p><?php echo get_field( ‘show_this_tomorrow’, $prev_post->ID ); ?></p> or <p><?php the_field( ‘show_this_tomorrow’, $prev_post->ID ); ?></p>

Categories post-meta Tags post-meta

Show posts between two Custom Fields date

Show posts between two Custom Fields date

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

How To Get WordPress Categories Last Update Date?

How To Get WordPress Categories Last Update Date?

Categories functions Tags categories, functions, post-meta

Best way to check if a post with specific meta exists

You can choose between simplicity and efficiency. Running a get_posts() with a meta query for every entry is the simplest approach, and will do the job. Of course, as you pointed out, there are performance considerations. If you are looking for a more efficient solution, you will have to dive as deep as the database … Read more

Categories loop Tags get-post, loop, post-meta

Query postmeta values, and return multiple post_titles for common meta value

Query postmeta values, and return multiple post_titles for common meta value

Categories custom-field Tags custom-field, post-meta, search, wpdb
Older posts
Newer posts
← Previous Page1 … Page31 Page32 Page33 … 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