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

List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?

It sounds like you’re looking for wp_get_object_terms() which takes an array of post IDs, a taxonomy, and some optional arguments to determine what to return. So, you’d use get_posts() to query future events, build an array of IDs, and then pass that array to wp_get_object_terms().

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

Function to update post_meta based on existing post_meta

Function to update post_meta based on existing post_meta

Categories functions Tags functions, post-meta

need to add add user names to the post for later retrieval or removal

Decided going to use comments system to implement this feature.

Categories post-meta Tags post-meta

Query posts by meta_key whose value is an array

Your array is a PHP construct and only meaningful to PHP, as far as MySQL is concerned it’s just a string of characters. If you need to query on that data it should be separated out into individual keys.

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

Limits, not all post are showen when querying for posts by view count

The problem is in the orderby it has to be ‘orderby’ => ‘meta_value_num’ And don’t forget wp_reset_postdata() at the end of the loop

Categories custom-field Tags custom-field, page-template, post-meta, query

Change Post Template based on post meta?

Try following code it will work with if statement as well. define( ‘MY_PLUGIN_PATH’, plugin_dir_path( __FILE__ ) ); function catch_plugin_template( $template ) { if( is_page_template(‘page_template.php’) ){ $template = MY_PLUGIN_PATH . ‘/page_template.php’; } return $template; } add_filter(‘template_include’, ‘catch_plugin_template’);

Categories page-template Tags page-template, post-meta

Getting thumbnails of a custom posts featured images in a page-templates metabox

You can get the image from your $thumb integer with the following additional code: $thumb = get_post_meta($p,”_thumbnail_id”,true); $image = wp_get_attachment_image_src($thumb); echo $image[0]; This will return the URL of the image, just put that in an img tag to display it.

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

Cannot retrieve a custom RSS field from posts

Do’h! I’m really dumb. It was the problem of parser, it’s choosy about retrieving fields. I had to manually add it into an array of allowed values in my parser.

Categories posts Tags custom-field, post-meta, posts, rss

Compare string with post id in wpdb and do stuff when match is found

This is what I ended up using, turned out I didn’t need to apply the meta value to the child pages since I used another approach. Hopefully it’s useful for someone. $row = $wpdb->get_row(“SELECT * FROM wp_posts WHERE ID =’$post_id'”); $new_order = $order[$page[‘depth’]]; $new_order = $wpdb->escape($new_order); $current_order = $row->menu_order; if($current_order != $new_order) { switch ($new_order) … Read more

Categories post-meta Tags menu-order, post-meta, wpdb

How to increase load time of an archive/search page (WP_Query)

How to increase load time of an archive/search page (WP_Query)

Categories wp-query Tags performance, post-meta, query-posts, wp-query
Older posts
Newer posts
← Previous Page1 … Page122 Page123 Page124 … 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