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

I need query_posts() to order results first by a meta value and then by post ID

I continued to research my issue and ended up finding the solution here: I need query_posts() to order results first by a meta value and then by post ID Basically, it seems the WordPress orderby is screwed. When I examined the SQL it was producing the orderby looked like this: ORDER BY wppc_postmeta.meta_value+0 DESC Which … Read more

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

How do you update post date (year only) in a separate custom field?

So I was first looking for a way to loop through the existing posts, as suggested in Christine’s comment. Based on this answer, I created a basic plugin that runs the loop upon activation. // Run the loop when the plugin is activated register_activation_hook(__FILE__, ‘update_my_metadata’); function update_my_metadata(){ $args = array( ‘post_type’ => ‘post’, // Only … Read more

Categories posts Tags custom-field, date, date-time, post-meta, posts

How to properly get the wp_postmeta.meta_value of a custom post type in specifics?

How to properly get the wp_postmeta.meta_value of a custom post type in specifics?

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

Saving custom post types post_meta over REST-API fails

The register_meta() function is defined like so: function register_meta( $object_type, $meta_key, $args, $deprecated = null ) And the $object_type (as of now) has to be post for all post types. So use this: register_meta( ‘post’, ‘survey_data’, … ) See the // {comments} in the code below, which I copied from here: <?php // The object … Read more

Categories custom-post-types Tags custom-post-types, post-meta, rest-api

How to add/update post meta to use in query?

You can use this function, which you’d add to the theme’s functions.php file, to update the average post rating which is saved in a private meta named _avg_rating (but you can of course rename it) — private meta has their name starting with an underscore (_): function update_post_avg_rating( $comment_id, $post_id = 0 ) { if … Read more

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

Reference multiple style sheets, clearing styles for permalink page, custom fields for css

Managed to get the custom field method to work, which saves alot of headache in the long run, solution was simple – <?php post_class(get_field(‘the-field’)); ?>

Categories functions Tags advanced-custom-fields, css, custom-field, functions, post-meta

Get meta values from parent post and save in child post

Get meta values from parent post and save in child post

Categories custom-post-types Tags categories, custom-post-types, metabox, php, post-meta

Custom meta POST request fired twice when updating a post in Gutenberg

Custom meta POST request fired twice when updating a post in Gutenberg

Categories custom-field Tags block-editor, custom-field, post-meta, rest-api

Get Previous Post based on Custom Field Name, for Custom Post Type

Get Previous Post based on Custom Field Name, for Custom Post Type

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

Please tell how to stop the category from showing up on posts

Maybe commenting out that magazine_7_post_item_tag() call?

Categories categories Tags categories, content, loop, post-meta
Older posts
Newer posts
← Previous Page1 … Page52 Page53 Page54 … 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