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

Add post’s category as a meta tag to the post

You can use the below snippet to achieve the result. add_action( ‘wp_head’, ‘so_407790_add_meta_tags_to_post’ ); /** * Add category meta tags to post. */ function so_407790_add_meta_tags_to_post() { // Get the current page categories. $categories = get_the_category(); if ( ! $categories ) { return; } // Category slug into list with comma separated. $category_list = implode( ‘,’, … Read more

Categories post-meta Tags post-meta

Filter posts by meta key

By passing the meta key parameters. you can filter you posts. $args = array( ‘post_type’ => ‘post_type’,(optional) ‘meta_key’ => ‘age’, ‘meta_query’ => array( array( ‘key’ => ‘loan_min’, ‘value’ => $amount, ‘compare’ => ‘>=’, ), array( ‘key’ => ‘loan_min’, ‘value’ => $amount, ‘compare’ => ‘<=’, ), ), ); $query = new WP_Query( $args ); You can … Read more

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

Cant create or update meta fields using WordPress REST API

Cant create or update meta fields using WordPress REST API

Categories post-meta Tags post-meta, rest-api, wp-api

How to remove date from showing in meta description

I havent tried these yet but I was actually looking at the exact same thing the other day. http://magstags.com/wordpress-seo/remove-date-meta-descriptions-wordpress-seo/ and http://seo-ho.blogspot.com/2011/02/how-to-remove-date-from-meta.html

Categories post-meta Tags post-meta, seo

troubles with get_post_meta (and saving it)

here’s the complete code : if somebody could try it, i might doing something wrong, but i can’t find out what. (the whole code is inside a widget page) /* * * add meta box : habillage * */ add_action( ‘add_meta_boxes’, ‘myplugin_add_custom_box’ ); add_action( ‘save_post’, ‘myplugin_save_postdata’ ); /* Adds a box to the main column … Read more

Categories post-meta Tags post-meta, save-post

Is there a way combine posts meta_name?

you can use the same meta_key for multiple values, for example: meta_key – ‘links’ meta_value – ‘link1’ meta_key – ‘links’ meta_value – ‘link2’ then you can get the meta as an array of links: $links = get_post_meta($post->ID, ‘links’); if ($links){ foreach ($links as $link){ echo $link; } }

Categories post-meta Tags post-meta

How to query and update one colum in postmeta table?

You probably would have to use a script which would have to be referenced in your crontab. The problem is to calculate the final value of the popularity for each post, but if you apply the funcion the right way in the PHP script, the UPDATE operation on your MySQL database should work nicely. Here … Read more

Categories post-meta Tags post-meta, wpdb

add post meta front end edit

This code should be conditional first and then form output since you can’t use wp_redirect after headers are set and you are updating so use update_post_meta instead of add_post_meta. Try: if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] && !empty( $_POST[‘action’] ) && $_POST[‘action’] == “edit_post” && isset($_POST[‘pid’])) { $the_post = get_post($_POST[‘pid’]); $the_post = array(); $the_post[‘post_content’] = $_POST[‘description’]; $the_post[‘data’] … Read more

Categories post-meta Tags front-end, metabox, post-editor, post-meta

Displaying the ‘time ago’ for recent activity within a post/custom post type?

You can do this within the Loop: <p>Last modified on the: <?php the_modified_date(); ?>. by: <?php the_author(); ?></p>

Categories post-meta Tags post-meta

wpdb->get_var – count author posts, meta value

This wouldn’t be possible unless you keep a log of users that have voted the Idea. You will have to create another hidden post_meta array which will store a list of all the users who have voted the Idea. In that way you could count the number of votes an author has given. Or better … Read more

Categories post-meta Tags author, count, post-meta, wpdb
Older posts
Newer posts
← Previous Page1 … Page19 Page20 Page21 … Page51 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