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

Get a row from a separate table by matching a posts meta_key to a tables ID column

global $wpdb; /* grab meta value, it is assumed you know the post id ($id) in question */ $dot_number = get_post_meta( $id, ‘dot_number’, true ); /* grab all rows with matching value in ‘dot_number’ column */ $matches_query = $wpdb->get_results( “SELECT * FROM ” . $wpdb->prefix . “csadata ” . “WHERE dot_number = ” . $dot_number, … Read more

Categories post-meta Tags get-row, post-meta, wpdb

Importing Data from a Non-WordPress database, into WP

You should wirte a Function or Plugin inside WordPress to achive that. First, you could insert the tables into your WordPress Database. After that, make sure you make good use of the WordPress postsstructure. Set up a Loop through your existing Posts that you want to import. At each Post create a WordPress Post using … Read more

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

How to prevent further updates of custom meta when using actions to set one meta based on another

How to prevent further updates of custom meta when using actions to set one meta based on another

Categories metabox Tags actions, metabox, post-meta

Post meta not updating

The server-side code looks to be OK (at a glance) but you are not calling the correct server-side code from your JavaScript. Have a look at this: http://wp.smashingmagazine.com/2011/10/18/how-to-use-ajax-in-wordpress/. You need to have an Ajax call to admin-ajax.php?action=<your action>

Categories functions Tags functions, post-meta

get_posts in meta box dropdown not showing latest posts

Try WP_Query to get the posts, since get_posts() also makes use of it: $args = array( ‘category_name’ => ‘product-videos’, ‘posts_per_page’ => 5000, // or -1 if you want all ‘offset’ => 1 ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ): $the_query->the_post(); ?> <option value=”<?php the_ID(); ?>” <?php … Read more

Categories custom-field Tags custom-field, get-posts, metabox, post-meta, wpalchemy

Saving zero as meta value

if ( !$value ) evaluates to TRUE when the value is 0. Alternative: if ( ! isset ( $_POST[‘_ordre’] ) ) return delete_post_meta( $post_id, ‘_ordre’ ); update_post_meta( $post_id, ‘_ordre’, $_POST[‘_ordre’] ); You don’t need add_post_meta(), the call to update_post_meta() will do that automatically.

Categories Database Tags database, meta-value, post-meta, save-post

Attach time/date stamp on add_post_meta

Attach time/date stamp on add_post_meta

Categories ajax Tags ajax, post-meta

Custom WP_Query for WordPress Search Results with meta_query

Custom WP_Query for WordPress Search Results with meta_query

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

Is it possible to paste a link without tags and make it directly a link in a post?

I use a similar method to the following in a plugin of mine: function wpse107488_urls_to_links( $string ) { /* make sure there is an http:// on all URLs */ $string = preg_replace( “/([^\w\/])(www\.[a-z0-9\-]+\.[a-z0-9\-]+)/i”, “$1http://$2”, $string ); /* create links */ $string = preg_replace( “/([\w]+:\/\/[\w-?&;%#~=\.\/\@]+[\w\/])/i”, “<a target=\”_blank\” title=\”” . __( ‘Visit Site’, ‘your-textdomain’ ) . “\” … Read more

Categories posts Tags comments, links, post-meta, posts

Editing does not change post_name

Editing does not change post_name

Categories post-meta Tags post-editor, post-meta, title, urls
Older posts
Newer posts
← Previous Page1 … Page123 Page124 Page125 … 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