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 interconnect custom post types?

You only need to define two post types: ‘piece’ and ‘person’ and a connection field ‘role’. See https://github.com/scribu/wp-posts-to-posts/wiki/Connection-information

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

Change the post date from a meta box

A Note: Actions and Filters are not really interchangeable: Filters typically must return the passed data or it’s going to break something. Building off of what m0r7if3r said, wp_insert_post_data is a filter, so you should be modifying the post’s $data and returning it at the end of the function. (Alternatively, you could global the variables … Read more

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

Export entries and multiple custom field meta to .csv?

With the help of @toscho pointing out get_post();, I was able to spit out a .csv with a blank template. At first, I had memory limit issues b/c of the amount of data, so I moved the site locally and was able to get everything I need with the get_post(); This is the gist of … Read more

Categories custom-post-types Tags csv, custom-post-types, export, post-meta, sql

How to get meta box values – WP tuts tutorial

After reviewing your code there are a couple of things you need to change depending on where the meta content is being held. If you try $meta = get_post_meta( get_the_ID(), ‘custom_text’, TRUE ); echo ‘The meta content is: ‘ . $meta;` That should give you the appropriate meta. You are calling this function on the … Read more

Categories metabox Tags metabox, post-meta

How to Display Image Meta underneath EVERY image in EVERY post

UPDATE I did not test this method, but it is not very old. It adds custom meta information to the caption section of the image, which can then be styled as needed. Again, I did not try the method, and I am not a coder, but from reading through the tutorial, it sounds like it … Read more

Categories PHP Tags functions, php, post-meta, post-thumbnails

How to get the post-ID in my plugin?

There are several issues with your code. Let’s start at the beginning… Adding hooks All your hooks will be added at the backend. Even those which are outside the if((is_admin)) branch. Add your hooks explicitly where they should work: if (is_admin()){ // do this on backend (admin side) /* load plugin functions */ add_action(‘add_meta_boxes’, ‘myplugin_add_meta_box’); … Read more

Categories themes Tags post-meta, themes

How to update Post Meta values through the comment system

$parent_post is an object, update_post_meta requires the ID, so should be: update_post_meta( $parent_post->ID, ‘average_wr’, $commentdata );

Categories post-meta Tags comment-meta, post-meta

Pull post meta with post_query?

Actually, you’re a mistaken on a couple of points here. 1. Don’t use query_posts() This function is meant for modifying an existing query, not performing a standalone query. You should either use get_posts() or a new instance of the WP_Query() class to perform your query for the custom loop. Here’s some further reading on query_posts(): … Read more

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

One post carries 30 postmeta values, is this too much?

No, to be honest 35 is nothing. You should not see any problems scaling this into the hundreds/thousands if optimized right, it does depend on many factors. Where is the post meta being used, are you sure it’s all being used? Are you using a lot of unique keys? You can check this by doing … Read more

Categories Database Tags database, performance, post-meta

Add custom field automatically (add_post_meta) with value based on number of words of article

Hook into save_post, count the words, and update the post meta field. Sample code, not tested: add_action( ‘save_post’, ‘wpse_73563_save_word_count’, 10, 2 ); function wpse_73563_save_word_count( $post_ID, $post ) { if ( ! current_user_can( ‘edit_’ . $_POST[‘post_type’], $post_ID ) ) { return FALSE; } $count = t5_word_count( $post->post_content ); update_post_meta( $post_ID, ‘_word_count’, ( 200 > $count ? … Read more

Categories posts Tags custom-field, post-meta, posts
Older posts
Newer posts
← Previous Page1 … Page156 Page157 Page158 … 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