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

Custom attachment function not working in v5.4.2?

it was completely my bad. I am using this plugin and I updated my functions.php file but the plugin wasn’t activated although I thought it had been. Extension is here & it works in 5.4.2 with Gutenberg blocks if anybody is intereested: https://github.com/jchristopher/attachments

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

How to exclude posts by meta key value in the_post_navigation next prev links?

In your code this in the condition where you decide when to apply the meta query condition: if($query->is_main_query()) { Therefore if the conditions inside there are working sometimes and not others, it means that condition is true when it’s working and not when it’s not. The solution to this is dependent on all the code … Read more

Categories post-meta Tags navigation, next-post-link, post-meta, previous-post-link

Convert post meta to custom taxonomy?

You will need to write some code for this I think. Start creating the new taxonomies and the query the right custom field to get the list of values. Use wp_insert_term() to add the new term. Then use wp_set_post_terms() to assign the terms to each post.

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

Update wp_postmeta table based on 2 keys

Yes, there is. These are some WP functions to get, add and update post meta values: get_post_meta() add_post_meta() update_post_meta() Your code could be: $meta_value = (int) get_post_meta( $post->ID, ‘meta_key’, true ); update_post_meta( $post->ID, ‘meta_key’, $meta_value + 1 );

Categories functions Tags database, functions, post-meta

How to keep custom post type related information

You have a few potential options that I can see: Each CPT has a parameter for a Description, and you could access that via a plugin like CPT UI for admin purposes (though not ideal if you want non-admin users to have access to control the Description!) Create a theme/plugin option page to control the … Read more

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

Unable to gather Image URL from Custom Post Type’s; Custom Meta Field

If you want the image URL you should use wp_get_attachment_image_url(), not wp_get_attachment_image(): $background_image_id = get_post_meta(get_the_ID(), ‘your_background_image_id’, true); $background_image = wp_get_attachment_image_url( $background_image_id, ‘full’ ); $profile_image_id = get_post_meta(get_the_ID(), ‘your_profile_picture_id’, true); $profile_image = wp_get_attachment_image_url( $profile_image_id, ‘full’ ); ?> wp_get_attachment_image() returns a full HTML <img> tag, but background images are just a URL.

Categories custom-post-types Tags custom-field, custom-post-types, meta-query, plugin-development, post-meta

No more get_option(‘date_time’) in WordPress 5.5?

Okay I found the issue, it’s like I thought. The problem is that get_option( ‘date_time’ ) return just false. The change happened in the funtion get_the_date(). In WordPress 5.4 is looked like that in the general-template.php: function get_the_date( $format=””, $post = null ) { $post = get_post( $post ); if ( ! $post ) { … Read more

Categories PHP Tags date-time, options, php, post-meta

How to get posts by meta value as multi-dimensional array?

How to get posts by meta value as multi-dimensional array?

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

Trouble with serialized metadata

For 99% of cases, no, you can’t. Serialised data is not something you can search, and that is the fundamental problem. Not how to search it, but that it was serialised to begin with. Serialising is unnecessary. This is for the same reasons you cannot unscramble an egg, serialised data, especially PHP serialised data, is … Read more

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

Meta query ignores multiple values of the key

Meta query ignores multiple values of the key

Categories wp-query Tags meta-query, post-meta, wp-query
Older posts
Newer posts
← Previous Page1 … Page63 Page64 Page65 … 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