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

Help with Post Meta

This makes no sense, required $key argument (defines which custom field value you want to retrieve) is missing: $post_meta = get_post_meta( $post->ID ); How are you actually assigning this to post? In this snippet you only assign array to some arbitrary variable: $brand_meta = array(… Also please clarify your condition, I am not sure what … Read more

Categories post-meta Tags post-meta

Add box with custom per-page properties

In WordPress these boxes are called “meta box” and to add one to your new/edit page screen you can use add_meta_box() function (look at the example at the bottom for the examples), you can also use this class which is nicely documented and does most of the job for you. Or you can use a … Read more

Categories post-meta Tags metabox, post-meta

How to obtain a group of post meta and assign each meta to other variables?

foreach ($boxes as $data) { $project[$data] = get_post_meta($post->ID, $data, true); } $item_a = $project[‘height’]; $item_b = $project[‘width’];

Categories post-meta Tags post-meta

Parse a text area custom meta box and assign as value to existing meta keys

This is a very simple script that will split up the text of the box in different lines and fill them in in the title, excerpt and two custom fields. jQuery( function( $ ) { $( ‘#wpse18528_paste_box’ ).keyup( function() { var text = $( ‘#wpse18528_paste_box’ ).val(); var lines = text.split( /[\n\r]+/ ); $( ‘#title’ ).val( … Read more

Categories metabox Tags cms, metabox, post-meta

Let’s Create Custom Field Template Documentation

Create a public gist or a repository. You can use multiple files per gist, everyone can comment or fork the project. It is like a wiki for developers. 🙂

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

search serialised meta_value for date value?

Don’t serialize the search value, just use ‘value’ => ‘2011-09-16’ ‘compare’ => ‘LIKE’. Otherwise you’re essentially looking for; a:1:{i:0;s:10:”2011-09-16″} Which of course doesn’t actually match anywhere in; a:2:{i:0;s:10:”2011-09-16″;i:1;s:10:”2011-09-17″;}

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

Is there a way to only show Custom Meta Data on single posts from certain catagories

get_query_var(‘cat’); only returns the category id in a category archive page; in a single post, try to use, for instance: wp_get_post_categories() example: if( in_array(4, wp_get_post_categories($post->ID)) ) : http://codex.wordpress.org/Function_Reference/wp_get_post_categories

Categories categories Tags categories, post-meta

Query posts WITHOUT a custom meta field

You have to do a join or a subquery: $querystr = ” SELECT $wpdb->posts.ID FROM $wpdb->posts WHERE $wpdb->posts.post_type=”post” AND $wpdb->posts.post_date < NOW() AND $wpdb->posts.ID NOT IN ( SELECT DISTINCT post_id FROM $wpdb->postmeta WHERE meta_key = ‘_social_’ ) ORDER BY $wpdb->posts.score DESC LIMIT 1; “;

Categories post-meta Tags post-meta, query

How to query two meta fields and display results between them

You will need to use the meta_query variable like so: $start = time(); //Now $end= strtotime(‘+1 month’); //1 month ahead query_posts( ‘post_type’ => ‘event’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => ’10’, ‘meta_query’ => array( array(‘key’ => $prefix.’event_start_timestamp’, ‘value’ => $start, ‘compare’ => ‘>=’, ‘type’ => ‘NUMERIC’), array(‘key’ => $prefix.’event_end_timestamp’, ‘value’ => $end, ‘compare’ => ‘<=’, ‘type’ … Read more

Categories search Tags post-meta, query, search

How do I query the title (or handle?) of post meta fieldset (created with Simple Fields Plugin)

The values you have circled are not part of the custom fields. They are part of the configuration data of Simple Fields. You can find them in the dadabase in table wp_options in the row with option_name=simple_fields_groups. Field option_value contains a string of serialized data. You can read the option with WP function get_option(). It … Read more

Categories custom-field Tags custom-field, post-meta
Older posts
Newer posts
← Previous Page1 … Page104 Page105 Page106 … 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