Date when the custom field was added

By default, there are no creation dates associated with custom meta fields. If you check the description, you can see that it is a very simple table of key/value pairs associated with a post ID, plus an auto-increment field. There is no time component at all. The only thing you can do with default functionality … Read more

How to make a template for a specific post of a custom post type?

As Pages are a special built in Posttype, they get an own template hierarchy. Other “normal” post types and custom post types can only be templated by “single-$posttype.php”. You can however hook into the single_template filter and make wordpress redirect to your template file: function get_custom_post_type_template($single_template) { global $post; if ($post->post_type == ‘account’) { $located … Read more

How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?

The get_template_part(‘content’, get_post_format()); line includes content from one of the other files in your theme based on the post type, the file name will be something like content-page.php (or content.php if the format is not found). If you print out what get_post_format() returns, you will be able to tell which content file to look into. … Read more

Replace Unwanted Space in Post Content URL

I think you should run this query. To replace space with dash. update wp_posts set wp_posts.post_name = REPLACE( wp_posts.post_name, ‘ ‘, ‘-‘ ); Don’t forget to change table_prefix in this. And also, keep a backup on current database before trying.

Saving an upload media meta box field

use these: $imgurl = isset( $values[‘upload_image’] ) ? esc_attr( $values[‘upload_image’][0] ) : ”; <input id=”upload_image” type=”text” size=”36″ name=”upload_image” value=”<?php echo $imgurl; ?>” /> <input id=”upload_image_button” type=”button” value=”Upload Image” /> if( isset( $_POST[‘upload_image’] ) ) update_post_meta( $post_id, ‘upload_image’, wp_kses_data( $_POST[‘upload_image’] ) );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)