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

Editing post in admin panel

Editing post in admin panel

Categories admin Tags admin, front-end, post-meta

Check whether attachment ID is associated with more than one post?

you can use following way $attachment_id = 5; //put here you attachment id $sql = “SELECT count(DISTINCT pm.post_id) FROM $wpdb->postmeta pm JOIN $wpdb->posts p ON (p.ID = pm.post_id) WHERE pm.meta_key = ‘_thumbnail_id’ AND pm.meta_value=”$attachment_id” AND p.post_type=”post” AND p.post_status=”publish””; $count = $wpdb->get_var($sql);

Categories attachments Tags attachments, meta-query, post-meta

Custom Filter using meta_value in wordpress admin list not working

The initial thing that jumps out is that you’re using: template=default in the URL, but in the code you are using if( isset($_GET[‘_wp_page_template’]) && !empty($_GET[‘_wp_page_template’]) ) { you should be checking: if( isset($_GET[‘template’]) && !empty($_GET[‘template’]) ) { Also, don’t forget to sanitize the $_GET as that’s user input and cannot be trusted. Hope that helps.

Categories pages Tags filters, page-template, pages, post-meta, post-type

Getting meta content from get_next_post & get_previous_post

Getting meta content from get_next_post & get_previous_post

Categories post-meta Tags post-meta, previous

Postmeta not saving

This part: // verify nonce if (!wp_verify_nonce($_POST[‘subtitle_meta_box_nonce’], basename(__FILE__))) { return $post_id; } else { die( ‘failed to verify nonce’ ); } should be: // verify nonce if (!wp_verify_nonce($_POST[‘subtitle_meta_box_nonce’], basename(__FILE__))) { return; }

Categories PHP Tags functions, php, post-meta

Where to put a migration script to switch post information?

Your options are: Paste the code into a plugin Paste the code into a mu-plugin file Paste the code into a theme file like functions.php I manage this kind of thing with a plugin that builds a simple interface– basically an “execute” button. I alter the code that executes as needed. That seems to give … Read more

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

add_post_meta displays in admin edit area

Just add custom-field support to your custom post; register_post_type( ‘YourPosts’, array( ‘labels’ => array( ‘name’ => __( ‘YourPosts’ ), ‘singular_name’ => __( ‘YourPost’ ) ), ‘public’ => true, ‘has_archive’ => true, ‘supports’ => array( ‘title’, ‘editor’, ‘custom-fields’, ) ) );

Categories wp-admin Tags post-meta, wp-admin, wp-insert-post

Meta title W3C Validation Error with

title is not part of the current HTML5 spec for meta element names. See here. The <title> element in the document head should be enough for metadata purposes.

Categories themes Tags html, post-meta, themes, validation

Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working

Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working

Categories posts Tags loop, post-meta, posts

Hide H1 Title using the_title filter

Depending on the way your theme uses the_title, hooking into the the_title filter may or may not hide the title h1. What theme are you using? The the_title filter passes two arguments: the title (string) and the post ID. Therefore, treating the title as an array (it looks like you’re assuming $title is an array … Read more

Categories filters Tags filters, get-the-title, hooks, post-meta, title
Older posts
Newer posts
← Previous Page1 … Page25 Page26 Page27 … 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