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_schedule_event not working

wp_schedule_event not working

Categories post-meta Tags post-meta

Custom Post Type meta oembed html output resulting in WSoD

You start a while loop using the colon syntax, but never end the while loop with endwhile properly. Your template is thus incomplete, and this is what is giving you the syntax error.

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

Copy wp_postmeta from one database to another

It’s even easier than what you did. . Copy the entire wp structure from the old server to the new, mysql backup the database with creates enabled and import to the new database (preferably blank) . Then just edit the wp configuration file for the new locations of everything (including database name) . I have … Read more

Categories post-thumbnails Tags mysql, post-meta, post-thumbnails

change attachment custom field onChange event

Replace the function into your functions.php file – function update_dynamic_select() { update_post_meta($_POST[‘aid’], $_POST[‘field’], $_POST[‘value’]); echo $_POST[‘value’]; die(); } Replace options in your HTML part – <?php $val = get_post_meta( 104, ‘_image_matmenys’, true ); $s1 = ($val == “10×10″) ? ‘selected=”selected”‘ : ”; $s2 = ($val == “20×20″) ? ‘selected=”selected”‘ : ”; $s3 = ($val == … Read more

Categories custom-field Tags ajax, custom-field, filters, hooks, post-meta

Display Posts by Views (Popular Posts Widget)

It could be fix using session, try following. Initialize session using following code in your functions.php. function init_sessions() { if (!session_id()) { session_start(); } } add_action(‘init’, ‘init_sessions’); add a function for setting session function set_session_posts_viewed($postID) { if(empty($_SESSION[‘posts_viewed’])) { $posts_viewed = array($postID); $_SESSION[‘posts_viewed’] = $posts_viewed; } else { $posts_viewed = $_SESSION[‘posts_viewed’]; $posts_viewed[] = $postID; $_SESSION[‘posts_viewed’] = … Read more

Categories widgets Tags post-meta, widgets

How to order posts by the user_login that corresponds to a meta_value (which is a user id)?

Ok, solved this. I had to use the posts_clausesfilter and the following code: function assigned_to_orderby( $clauses, $wp_query ) { global $wpdb; $clauses[‘join’] .= ” LEFT OUTER JOIN {$wpdb->postmeta} ON {$wpdb->posts}.ID={$wpdb->postmeta}.post_id LEFT OUTER JOIN {$wpdb->users} ON {$wpdb->users}.ID={$wpdb->postmeta}.meta_value “; $clauses[‘where’] .= ” AND ({$wpdb->postmeta}.meta_key = ‘assignee’)”; $clauses[‘groupby’] = “{$wpdb->postmeta}.post_id”; $clauses[‘orderby’] = “GROUP_CONCAT({$wpdb->users}.user_login ORDER BY {$wpdb->users}.user_login ASC) “; … Read more

Categories users Tags order, post-meta, sort, sql, users

Twenty Twelve entry meta data – change and move

If you don’t want to use twentytwelve_entry_meta(); in the post loops that calls the date, category and adds that “This post was posted in” text itself, then you’ll have to remove it and re-write from scratch. 1A: Comments and Number displayed, refer to the comments_number function: http://codex.wordpress.org/Function_Reference/comments_number <?php comments_number( ‘No Comments’, ‘Comments: 1’, ‘Comments: %’ … Read more

Categories post-meta Tags post-meta, theme-twenty-twelve

Custom meta box not saving values of radio buttons in WordPress

Your values are actually being saved – you can always check it in your database. The problem is in your metabox callback function post_options_callback – it is not being called with Post.ID value as an argument, but WP Post object is being passed. Here’s revisited piece of code: function post_options_callback( $post ) { $post_id = … Read more

Categories metabox Tags metabox, post-meta, radio

Save values from foreach loop in wp_editor

wp_editor function accepts (array) $settings param and that one can contain textarea_name as a key. If it’s not being specified, it’s set by default as $editor_id. See: https://github.com/WordPress/WordPress/blob/c392ff6f90d550bad876d8a984ad6b3b8a49cd96/wp-includes/class-wp-editor.php#L44 So you might want to do something like this: foreach ($get_url as $list) { … $settings = array( ‘textarea_name’ => ‘uploaded_csv[]’ ); … wp_editor( $link, $editor_id, $settings … Read more

Categories wp-editor Tags customization, post-meta, wp-editor

Return a single custom post from multiple meta queries

The problem was that the nc_hidden met property did not exist if it was not checked so there was essentially no value to query against. I swapped nc_hidden from a checkbox to a select and updated my query as required. The working query is now as follows: $query_args = array( ‘posts_per_page’ => ‘1’, ‘orderby’ => … Read more

Categories wp-query Tags meta-query, post-meta, wp-query
Older posts
Newer posts
← Previous Page1 … Page28 Page29 Page30 … 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