Thumbnail and Featured Image With Fixed Sizes?

For this situation, you should use add_image_size. You can find more info about it in the codex. What add_image_size does is register new sizes for your thumbnails, so you can use them with the_post_thumbnail (and other functions). Here´s the example from the codex: if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘category-thumb’, 300, 9999 ); … Read more

Cannot get post thumbnails to display

Last I checked (meaning, it may have been updated in 3.5 and I just haven’t noticed), passing an array for an arbitrary image size hasn’t worked since before WordPress 3.0. You have to pass a pre-defined image size. Try: Define your custom image size: add_image_size( ‘some-custom-name’, 150, 150, true ); (called along with add_theme_support( ‘post-thumbnails’ … Read more

Is it possible to get local image URL when also having photon active?

Definitely a hack solution, but the only one I know got to work thus far… <?php $bkg_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘single_post_thumbnail’ ); ?> <style> span { background-image: url(‘<?php echo preg_replace(“/\.jpg.*/”, “-50×50.jpg”, $bkg_image[0]); ?>’); } </style> Basically, I am fetching the non-photon URL, and doing a string replace of the end image URL ‘.jpg’ … Read more

Media thumbnail for custom post inside post content

@Ibraheem, you don’t have to use global $post, since it is in global. To check post type you can use get_post_type(). Using the_post_thumbnail is not properly implemented in this case, instead use get_the_post_thumbnail. Note: you can’t use has_post_thumbnail as tag condition if you are not set featured image. add_filter( ‘the_content’, ‘put_thumbnail_in_posting’ ); function put_thumbnail_in_posting( $content … Read more

Use Video as Featured Image

You can work around if you have time. – Install http://ffmpeg-php.sourceforge.net/ – Create a custom meta field (upload field – you can use a plugin) – In your template or loop, get retrieve the uploaded video URL and assign it to a variable – Use the following function to generate an image from the retrieved … Read more

PDF Image in content

There’s no easy way in version 4.8, as far as I know. Few ideas come to mind, regarding writing plugins to make it easier: Use the media_send_to_editor filter to modify the HTML output for the application/pdf mime type, to include the preview image. This makes it is easier for user to insert pdf preview images, … Read more

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