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

wordpress simple post multi rating with post_meta and user_meta

Based on this: Array ( [0] => Array ( [wpd_function_rating] => 33 [wpd_feature_rating] => 12 [wpd_support_rating] => 66 ) ) I can spot at least one problem. You have a nested array but are only looping over the top level. Here: foreach ( $ls_up_votes as $key => $value ) { if ( $key == $currentusr … Read more

Categories custom-field Tags custom-field, post-meta, rating, user-meta

How to update the ‘modified_time’ of a post ONLY when content is changed?

I guess, there is no exact way of retrieving the time only when the post’s content is updated until you change the core functionality of wordpress and that might lead to some other issues. But here is a workaround I would like to propose here. You can retrieve the time/date only when content is updated … Read more

Categories post-meta Tags date, post-meta, revisions

How can I prevent the post_modified column in wp_posts from being updated?

Add the following to functions.php when you are meddling and remove it after, or comment it out: function no_mod_wpse_136092($data,$postarr){ if (empty($postarr[‘ID’])) return $data; $old = get_post($postarr[‘ID’]); if (!empty($old)) { $data[‘post_modified’] = $old->post_modified; $data[‘post_modified_gmt’] = $old->post_modified_gmt; } return $data; } add_action(‘wp_insert_post_data’,’no_mod_wpse_136092′,10,2);

Categories post-meta Tags date, post-meta

Humanmade | Custom meta box class: How to display a repeatable meta box group?

Humanmade | Custom meta box class: How to display a repeatable meta box group?

Categories loop Tags loop, metabox, post-meta

Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy

This is my own solution, improvements welcome 🙂 Check for term ID and assign to variable. $term_id = (has_term(‘activity_1′,’activity-tax’) ? 1 : (has_term(‘activity_2′,’activity-tax’) ? 2 : (has_term(‘activity_3′,’activity-tax’) ? 3 : ”))); Use term ID variable in my get_posts parameters. $args = array( ‘post_type’ => ‘activity-post’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘activity-tax’, … Read more

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

How can I hide the category term for posts with none set?

You could use: <?php $categories_list = get_the_category_list( __( ‘, ‘, ‘twentyeleven’ ) ); if(has_category()) { echo $categories_list; } ?> Here’s the has_category function via the Codex.

Categories categories Tags categories, conditional-tags, post-meta

Mysterious template change after database import/export

Mysterious template change after database import/export

Categories templates Tags database, post-meta, templates

Change default options on attachment page

Change default options on attachment page

Categories theme-development Tags attachments, post-meta, theme-development

Get meta value and associated user meta

Just alter your database query to also grab the user ID, and then return an array of data objects (as opposed to just the meta value): function get_meta_values( $key, $type=”workout”, $status=”publish” ) { global $wpdb; if ( empty( $key ) ) return; $r = $wpdb->get_results( $wpdb->prepare( ” SELECT pm.meta_value, p.post_author FROM {$wpdb->postmeta} pm LEFT JOIN … Read more

Categories user-meta Tags post-meta, user-meta

How to count post meta key values for all posts in database

You have a structural problem with your data. Serialized data in the database is terrible if you need to search over pieces of that serialized data. There is no reliable, efficient, and certainly no easy, SQL query to search over serialized data. “serialization” is a PHP mechanism. It isn’t SQL. To the database that is … Read more

Categories wp-query Tags mysql, post-meta, wp-query
Older posts
Newer posts
← Previous Page1 … Page24 Page25 Page26 … 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