Grab YouTube Thumbnail AFTER Post?

Each YouTube video has 4 generated images. They are predictably formatted as follows http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg The first one in the list is a full size image and others are thumbnail images. so if you have the video url the you can extract the video id from it call your image, and to do … Read more

How do you get thumbnails to show up in the admin edit post?

This looks flawed: add_theme_support( ‘post-thumbnails’, array( ‘post’ ) ); add_theme_support( ‘post-thumbnails’, array( ‘page’ ) ); Do you see the post thumbnail box on pages? If so, you have just overwritten the support on posts with the second declaration. Better: add_theme_support( ‘post-thumbnails’, array( ‘post’, ‘page’ ) );

Featured Image missing in WordPress 3.2 Admin

For me, “Featured Image” was still missing from the Screen Options tab, even after clearing the cache and restarting the browser. In my case the problem was related to having a WordPress 3.2 Multisite install. With this setup, the Media upload buttons must be checked in Network Admin to enable the featured image meta box … Read more

How to add post featured image url to inline background url()?

You just need to retrieve the src attribute of the thumbnail: $thumb_src = wp_get_attachment_image_src ( get_post_thumbnail_id(‘thumbnail’)); $thumb_src is then an array containg the url, width and height of the thumbnail image. So something like… <div style=”background: url(<?php echo $thumb_src[0];?> ) !important;”>adasdasdasd </div> should work.

Use post thumbnail as div background

<div<?php if ( $thumbnail_id = get_post_thumbnail_id() ) { if ( $image_src = wp_get_attachment_image_src( $thumbnail_id, ‘normal-bg’ ) ) printf( ‘ style=”background-image: url(%s);”‘, $image_src[0] ); } ?>> Code should be pretty self explanatory – codex on wp_get_attachment_image_src. As for how I’ve formatted it; I find this the cleanest, easiest to read, without outputting unnecessary whitespace: <div style=”background-image: … Read more

is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’

Here’s something I wrote because my clients were using very high quality pngs, when they could be more lossy jpgs for web. Note this still preserves the original image, only changes the thumbnails. Add this to your functions.php <?php //Force PNG Thumbnails into JPGs add_filter(‘wp_generate_attachment_metadata’,’force_png_to_jpg’); function force_png_to_jpg($image_data) { $sizes = array(‘thumbnail’,’medium’,’large’); $upload_dir = wp_upload_dir(); $file … Read more

Images not working using Featured post

I believe there are some root-links that you haven’t changed. Please follow these steps Login to admin section www.xyz.com/wp-admin Navigate to settings->general-> and change the ‘Site Address (URL)’ and ‘WordPress Address (URL)’. Also please check the permalinks and settings->media there is an upload directory and the default wordpress location is wp-content/uploads, check if it is … Read more

Call Featured Image from Parent Page

I believe you want something like the following: <?php if( has_post_thumbnail( $post->post_parent ) ) { echo get_the_post_thumbnail( $post->post_parent ); } ?> Calling the_post_thumbnail(); should return the current post thumbnail, whereas using get_the_post_thumbnail(); will allow you to specify the ID, using the parent ID in your case. Function Reference for get_the_post_thumbnail() Also, if you’re doing this … Read more