How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?

Do you have custom post type videos? if not change videos to post add_meta_box( ‘my-meta-box-id’, ‘Enter Video ID’, ‘cd_meta_box_cb’, ‘post’, ‘normal’, ‘high’ ); Your code is fine but you are not saving the video type select box you just updated the id input field. Place this code in add_action(‘save_post’, ‘cd_meta_box_save’); if( isset( $_POST[‘my_meta_box_text’] ) && … Read more

Show ids of displayed media library items

Actually, wordpress stores the media library files also as a post format. so you can follow this way to get your attachment media file and their id’s. Hope this will help you. function get_images_from_media_library() { $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ =>’image’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => 5, ‘orderby’ => ‘rand’ ); $query_images = … Read more

How to get any tag ID

In your admin, go to Posts > Tags and then click edit for the tag you’re after – the URL in your browser address bar will look like: http://example.com/wp-admin/edit-tags.php?action=edit&taxonomy=post_tag&tag_ID=X&post_type=post See the part where tag_ID=X – that X is your tag ID.

$post->ID displays wrong ID

On that page $post->ID returns the ID of first blog post for given page. That is how it works. $post is set to the first post in the Loop. On single posts and pages that is the same as the post or page. On archive pages it is the first post in the result set. … Read more

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