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

wp_handle_upload error “Specified file failed upload test” but still creates attachment?

Try using media_handle_upload() instead, solved a similar problem for me.

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

Add Post Url to Manage Edit Screen

Always use get_permalink( $post_id ) to get the URI of a post. It takes care of changed permalink structures and SSL. Be aware that the similar named function the_permalink() does not accept a parameter. To get the permalink of a custom post type (or a regular post outside of the loop) you have to use … Read more

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

How to add “time” data this?

Well, the code you are using to count views does store the count data as a custom_field value. If I want the functionality you mentioned in question, I’d rather use a custom plugin to create a separate table in database to store view count and respective dates. So doing some queries you can display popular … Read more

Categories loop Tags loop, post-meta, views

Grouping related postmeta data via SQL query

If I understand your question correctly, this should work: function get_event_info($event_id = 0, $info = ” ) { global $wpdb; return $wpdb->get_col( $wpdb->prepare( “SELECT meta_value from $wpdb->postmeta WHERE meta_key = ‘%s’ AND post_id IN (SELECT DISTINCT post_id FROM $wpdb->postmeta WHERE meta_key = ‘event_id’ AND meta_value= %s )”, $info, $event_id ) ); } Use this like … Read more

Categories query Tags mysql, post-meta, query

Job of meta_key meta_value fields in database tables

Think of them as array key/value pairs (kinda). These tables are used to store additional data about particular posts, comments, or users. The meta_key is the name by which the meta_value is retrieved, plus you have associations with particular posts, comments, or users by means of IDs. As far as structure goes, that is about … Read more

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

How do I sort a custom post type admin column using two meta keys?

Store the date time as a single key in the format yyyy-mm-dd hh:mm:ss.

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

Filter list by a unique meta value dilemma

With some trial and error and help from @vancoder , the problem had to do with intval. The only section needing to be modified was the posts_where function. Had to remove the following line: $propertytype_value_number = intval( $_GET[‘propertytype_value_restrict_articles’] ); And change: AND meta_value=$beds_value_number )”; to AND meta_value=””.$_GET[“propertytype_value_restrict_articles’].”‘ )”; I had to also modify the original … Read more

Categories filters Tags actions, filters, post-meta

Set attached to state

Attachments are attached to a parent post. So when you get an attachment object, look into $attachment->post_parent. If that is 0, the file is not attached. The parent post ID refers always to another post in the posts table, never to an user. To attach the file to a user, you could create a hidden … Read more

Categories plugins Tags attachments, plugins, post-meta, posts

Hide post meta data on a specific category

Posting the answer that was solved by OP in one of the comments. This way it’s easier to read it. Hopefully a moderator can mark the question as solved. .page-template-template-magazine-php .post-meta, .category-services .post-meta { display:none; }

Categories categories Tags categories, child-theme, css, customization, post-meta

Problem With Order Item Meta In Woocommerce

Figured it out where I had if ( ! empty( $cart_item[‘presc_data’] ) ) woocommerce_add_order_item_meta( $item_id, ‘Olho Direito’, $cart_item[‘presc_right_sphere’] ); I had to change to $data = $cart_item[‘presc_data’]; if ( ! empty( $cart_item[‘presc_data’] ) ) woocommerce_add_order_item_meta( $item_id, ‘Olho Direito’, $data[‘presc_right_sphere’] );

Categories post-meta Tags post-meta, woocommerce-offtopic
Older posts
Newer posts
← Previous Page1 … Page163 Page164 Page165 … Page203 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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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