How to stop WordPress from creating native thumbnails?
Go to wp-admin/options-media.php Set width and height to 0 for all sizes you do not want to have created.
Go to wp-admin/options-media.php Set width and height to 0 for all sizes you do not want to have created.
I assume you need to show the image url to the user, for all sizes, within the Attachment Details screen. Using Underscore/Backbone We can extend the Attachment Details View, in a similar fashion as in my previous answer here and based on the media views in the core: <!– Custom template part –> <script type=”text/html” … Read more
The most simple form of the featured images (post thumbnails) looks like this: You need to have this piece of code in your functions.php file: add_theme_support( ‘post-thumbnails’ ); Then in the index.php, or any other template file you want to show the post thumb or featured images, you would add this: <?php the_post_thumbnail( ‘thumbnail’ ); … Read more
As far as I know, you can only run PHP from .php files, not .html, etc. So you should make sure you got that one right. But also you could try to use global $poster; for where you defined it and for where you are calling it. For example: in widget.php global $poster; and in … Read more
Assuming that this is a theme that you can edit– ie. one of your own creation– the_post_thumbnail accepts an argument for size. the_post_thumbnail( $size, $attr ); Just give it the size you want, for example: the_post_thumbnail(‘full’);
As a rule of thumb, responsive design should not be handled on the server side. The two main reasons for this is: The only kind of detection you can do on the server side is User-agent sniffing. Responsive design should be based on feature detection, not user agents. It’s too easy to run into caching … Read more
First, paste this function on your functions.php file. function catch_that_image() { global $post, $posts; $first_img = ”; ob_start(); ob_end_clean(); $output = preg_match_all(‘//i’, $post->post_content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ //Defines a default image $first_img = “/images/default.jpg”; } return $first_img; } Once done, you can simply call the function within the loop to display the … Read more
I think this may help you if(has_post_thumbnail()) { the_post_thumbnail( ‘full’ ); } Reference : Featured Images & Post Thumbnails
featured image url function passed post id and image size <?php $featured_img_url = get_the_post_thumbnail_url($prevPost->ID,’full’); ?> <img src=”https://wordpress.stackexchange.com/questions/299668/<?php echo $featured_img_url; ?>” />
Sorry to not help with your existing code but if you are open to using a plugin I can recommend: http://wordpress.org/extend/plugins/get-the-image/ It is great as it grabs the first image, or a featured image if you have one. You can also specify the dimensions to crop the image and an optional fallback image in case … Read more