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

MySQL Query that looks for post with Custom Field, then changes Category

I can’t tell here whether or not you have the WordPress API available to you. (Is this code that is being run from within an instance of WordPress, or is it being run by an external script on the WordPress database, without bootstrapping WordPress itself?) If you have the WordPress API, it is easy to … Read more

Categories custom-field Tags custom-field, mysql, post-meta

Change post_date to post_modified date on post template?

use this into the loop or if you want to change created date to modified date than replace that with below code. As I know this feature works from all version of wordpress after 2.1 <?php the_modified_date(); ?> More detail you can find here http://codex.wordpress.org/Template_Tags/the_modified_date

Categories posts Tags post-meta, posts, templates

dynamically generating plugin syntax

Sounds like a custom TinyMCE button would be the ideal candidate for the job. WordPress has an excellent write-up in the codex on how to create one; you’d essentially add a button to the TinyMCE toolbar with your own callback, which could trigger a modal pop-up to choose the audio file & insert the shortcode … Read more

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

How to query posts with certain custom meta data, and output Post data

Trying using WP_Query() using the meta_query arguments. Something like this: <?php $geotag_post_query_args = array( ‘meta_key’ => ‘latlng_readable’ ); $geotagged_posts = new WP_Query( $geotag_post_query_args ); ?> Now, $geotagged_posts is a query object, that should include all Posts that have the latlng_readable meta field. You can extract the $post data from this object the same as any … Read more

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

I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?

Here is what I would do: Run an SQL query like so: SELECT * FROM `wp_posts` WHERE `post_status` = ‘publish’ AND `post_type` = ‘post’ GROUP BY `post_author` ORDER BY `post_date` ASC LIMIT 100 The above will give you the first 100 authors to have a post published. or: SELECT * FROM `wp_posts` WHERE `post_status` = … Read more

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

Removing Post Meta from Category Pages?

try this: /** Customize the post meta function */ add_filter( ‘genesis_post_meta’, ‘post_meta_filter’ ); function post_meta_filter($post_meta) { if (!is_page()) { if (is_category()) $post_meta=””; else $post_meta=”[post_categories]”; return $post_meta; }}

Categories post-meta Tags post-meta

Nav Menu – Add class based on meta keys

Your code doesn’t because the global $post refers to the post/page being viewed (if there is one…). What is passed with nav_menu_css_class is a menu item – this is a particular post type. Among its properties are: object which stores: the post type if the link refers to a post the taxonomy if the link … Read more

Categories custom-field Tags custom-field, menus, navigation, post-meta, walker

How do I use wp_query for WordPress search?

You need to combine your search query with a new WP Query… That would be something like this, on your search.php <?php global $wp_query; // get the global object $thesearch = get_search_query(); // get the string searched // merge them with one or several meta_queries to meet your demand $args = array_merge( $wp_query->query, array( ‘meta_query’ … Read more

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

special characters after saving draft interpreted as �

try define(‘DB_CHARSET’, ‘utf8′); this is what’s in my wp-config.php and remove define(‘DB_CHARSET’, ‘UTF-8’);

Categories wp-admin Tags metabox, post-meta, wp-admin, wpalchemy

Does WordPress limit the length of slug names for Post Meta or Terms?

The meta_key field for the wp_postmeta table is set as varchar type entries with a length of 255 characters. Seems pretty lengthy. It’s meta_value partner parameter is set as longtext type. As for the term length, both name and slug are set as varchar with a length of 200 characters each in the wp_terms table.

Categories custom-post-types Tags custom-post-types, custom-taxonomy, post-meta, slug, terms
Older posts
Newer posts
← Previous Page1 … Page150 Page151 Page152 … 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