Wordpress thumbnails

14.08.2019
0
4
FPW Category Thumbnails

Setting featured images for posts / pages could be very time
consuming, especially when your media library holds hundreds of
pictures. Very often we select the same thumbnail for posts in
particular category. This plugin automates the process by inserting a
thumbnail based on category / thumbnail mapping while post / page is
being created or updated. Now bundled with FPW Post Thumbnails.

  • FPW Category Thumbnails - Settings - jаvascript on
  • FPW Category Thumbnails - Settings - jаvascript off
  • FPW Post Thumbnails - Settings - jаvascript on
  • FPW Post Thumbnails - Settings - jаvascript off

Upload fpw-category-thumbnails folder to the /wp-content/plugins/ directory If standalone plugin FPW Post Thumbnails is installed deactivate and remove it. WordPress Select Dashboards Appearance -> FPW Category Thumbnails and build category/thumbnail mapping

I got an ID for the image and assigned it to the category, and the plugin does not display it in posts.

The plugin does not display thumbnails by itself. This is your themes role.

Ive entered ID of a picture from NextGen Gallery and thumbnail doesnt show.

IDs from NextGen Gallery must be entered with ngg- prefix, so ID 230 should be entered as ngg-230.

What is required to use authors pictures as thumbnails?

Upload authors pictures into media library or NextGen gallery.
File names of authors pictures in media library must follow this naming convention: autor_id.jpg where id is authors user id.
File names of authors pictures in NextGen gallery must follow this naming convention: id.jpg where id is authors user id.
The name of NextGen gallery must be authors.

How to use fpwCategoryThumbnails::addThumbnailToPost method?

Look into Public method fpwCategoryThumbnails::addThumbnailToPost topic of Documentation.

Will both plugins work with jаvascript turned off?

Yes. Both plugins are functional with jаvascript turned off to comply with accessibility regulations.

Just to say that you save me hours of work! Thank you! Awesome 5

FPW Category Thumbnails . :

  • Frank P. Walentynowicz

FPW Category Thumbnails 1 . .

FPW Category Thumbnails .

?

, SVN , RSS.

1.8.0

  • FPW Post Thumbnails Fixed: Incorrect display sizes of .svg images

1.7.9

  • Added: Requires PHP: 5.6.20
  • Fixed: Incorrect preview sizes of .svg images

1.7.8

  • Added: Requires PHP: 5.2.4
  • Fixed: Requires at least: 3.4
  • Fixed: Replaced deprecated get_currentuserinfo() with wp_get_current_user()

1.7.7

  • Fixed: uninitialized map option

1.7.6

  • Fixed: corrected path to images for alerts

1.7.5

  • Changes in update info message

1.7.4

  • Changes in language pack loader
  • Minor CSS changes

1.7.3

  • Full compatibility with language packs
  • New post meta to store post thumbnails for multiple categories

1.7.2

  • Removed code for PHP 4 compatibility

1.7.1

  • Fixed Do not overwrite if post / page has thumbnail assigned already flag not respected on new posts

1.7.0

  • Added no jаvascript form submission handler

1.6.9

  • Removed some options
  • Added backup and restore thumbnails removed by Remove Thumbnails action
  • Modified help to reflect recent changes

1.6.8

  • Fixed few security vulnerabilities
  • Added new format of admin page title introduced in WP 4.3

1.6.7

  • FPW Post Thumbnails: fixed deprecated form of load_plugin_textdomain function

1.6.6

  • FPW Post Thumbnails: added shadow support for bordered thumbnails

1.6.5

  • FPW Category Thumbnails: transfered hiding current themes thumbnails from FPW Post Thumbnails to improve performance
  • FPW Post Thumbnails: transfered hiding current themes thumbnails to FPW Category Thumbnails to improve performance
  • FPW Post Thumbnails: removed Get Language File button as FPW Category Thumbnails handles it for both plugins

1.6.4.1 ( maintenance release )

  • FIXED: FPW Post Thumbnails not hiding themes thumbnails if both Content thumbnails enabled and Excerpt thumbnails enabled were off
  • FIXED: FPW Post Thumbnails dynamic CSS style did not set rounded corners correctly

1.6.4

  • FPW Category Thumbnails: Adds theme support for thumbnails if not provided by the current theme already
  • FPW Post Thumbnails: Added visibility control for current themes thumbnails
  • Changed help files for both plugins

1.6.3

  • CSS improvements

1.6.2

  • Fixed translation plurals
  • Added plugin icon

1.6.1

  • FPW Category Thumbnails and FPW Post Thumbnails: fixed version check not working when major versions changes

1.6.0

  • FPW Category Thumbnails: fixed Get Image ID malformed dialog since WordPress 3.8 for all flavours of NextGen Gallery

1.5.9

  • FPW Category Thumbnails: images compatible with Media Library, NextGEN Gallery up to 1.9.13, NextCellent Gallery, and NextGEN Gallery by Photocrati
  • FPW Category Thumbnails: optimized images display to rescale only when necessary
  • FPW Post Thumbnails: optimized images display to rescale only when necessary
  • FPW Post Thumbnails: standarized alt and title attributes of thumbnails
  • FPW Post Thumbnails: changed contextual help
  • text domain changed for compatibility with language packs and automated updates

1.5.8

  • FPW Category Thumbnails: modified contextual help
  • FPW Post Thumbnails: removed hide-if-no-js class from both Copy buttons
  • FPW Post Thumbnails: modified contextual help

1.5.7

  • FPW Category Thumbnails: added Thumbnail column to Posts -> Categories admin screen
  • FPW Category Thumbnails: fixed bug in jаvascript detection handler
  • FPW Post Thumbnails: added jаvascript detection handler
  • Removing plugins data from database on uninstallation handled independently from each other

1.5.6

  • Removed built-in front end stylesheet and added dynamic CSS instead ( FPW Post Thumbnails )

1.5.5

  • Added choice of base dimension for image scaling ( FPW Post Thumbnails )
  • Removed built-in stylesheet for preview and added dynamic CSS instead ( FPW Post Thumbnails )

1.5.4

  • Fixed mapping not being applied when post/page is created/updated in user context ( eg. xmlrpc )

1.5.3

  • Added option to enable / disable built-in FPW Post Thumbnails

1.5.2

  • Added check to prevent activation if standalone version of FPW Post Thumbnails plugin is installed and active

1.5.1

  • Dropped support for WordPress versions lower than 3.3
  • Bundled with FPW Post Thumbnails plugin
  • Moved to Appearance menu of the Dashboard
  • Loading jаvascript into the footer

1.5.0

  • Major release
  • Dropped support for WordPress versions lower than 3.1
  • Uses WP_List_Table descendant to display category / thumbnail mapping
  • Full AJAX implementation of all operations
  • Ensured proper operation when jаvascript is disabled
  • Support for downloading of translation files from plugins repository

1.4.9

  • Last version supporting WordPress versions from 2.9 and lower than 3.1
  • Added code to prevent plugin being activated when WordPress version is lower than 2.9
  • Exposed method fpwCategoryThumbnails::addThumbnailToPost for both back and front end
  • Minor code modifications

1.4.8

  • Added support for pointers ( WP 3.3+ )
  • Minor bugs fixes

1.4.7

  • Fixed issues with PHP notices about uninitialized $_POST index
  • Fixed external links to plugins website ( changed permalinks at fw2s.com )

1.4.6

  • New feature: authors pictures as thumbnails
  • Updated .pot file for translations

1.4.5

  • Added missing strings for translations
  • Fixed loading of text domain for translations
  • Included Polish translation

1.4.4

  • Change to make it 100% predictable which thumbnail will be used in case of multiple categories selection

1.4.3

  • Optimized code to use less resources

1.4.2

  • Changed support links to reflect changes to FWSS site

1.4.1

  • Prevents adding thumbnails to drafts
  • Adding actions and filters to back end only

1.4.0

  • Maintenance release
  • Recoded using classes to prevent naming conflicts

1.3.9

  • Optimized for WordPress 3.3
  • Code cleanup

1.3.8

  • New option ( width of Image ID column )
  • New ability to AJAX-ed refresh of Preview column after manual insertion of ID
  • Added missing text for Help screens
  • Various code modifications

1.3.7

  • Code improvements
  • Full localization of jаvascripts
  • WordPress 3.3 ready

1.3.6

  • Minified jаvascripts
  • Fixed problem of loading scripts on all admin pages

1.3.5

  • Added confirmation dialogs for bulk actions

1.3.4

  • Improved code for bulk actions to reduce memory use
  • Modified media-upload to simplify image ID extraction
  • Added option to show / hide dashboard widget
  • Added AJAX preview of thumbnails on settings screen

1.3.3

  • Added FPW Plugins to admin bar for WordPress 3.1+

1.3.2

  • Fixed problem with extraction of image id from NextGEN library

1.3.1

  • Fixed problem with jаvascripts conflicts
  • Added a button to clear assigned image id

1.3.0

  • Major release
  • Added support for media upload
  • Code cleanup

1.2.3

  • Changed code to properly recognize location of installation core files
  • Security related changes
  • Visual enhancements to Settings page

1.2.2

  • Minor code improvements. Extensive tests on WP 3.1.1

1.2.1

  • Fixed a bug ( new posts only ) causing default category thumbnail being set instead of the one of selected category when do not overwrite flag is on

1.2.0

  • Added checks to avoid operations on post revisions

1.1.9

  • Added plugins dashboard info widget

1.1.8

  • Changed minimum role required to manage settings
  • Moved table of available images to contextual help

1.1.7

  • Combined default contextual help content and plugins contextual help content
  • Updated translations

1.1.6

  • Moved Description and Instructions blocks to contextual help

1.1.5

  • Added table of available images

1.1.4

  • Added plugin activation action to apply proper extension to uninstall( .txt/ .php) file based on option setting in database

1.1.3

  • Plugin code optimization
  • Minor fixes

1.1.2

  • Added: update information line to plugins meta block which shows only when update is detected

1.1.1

  • Added: immediate action to apply all mappings to existing posts/pages
  • Added: immediate action to unconditionally remove thumbnails from existing posts/pages

1.1.0

  • Changed: changed from thumbnails to category names mapping to thumbnails to category ids mapping
  • Changed: category listing shows category names and ids reflecting hierarchy of categories

1.0.4

  • Added: change name of uninstall file based on cleanup flag

1.0.3

  • Added: option to prevent overwriting if post/page has thumbnail allready
  • Updated: translations

1.0.2

  • Added: link to Settings into plugins action links
  • Added: database cleanup on uninstall
  • Updated: translations

1.0.1

  • Added: check if current theme supports post thumbnails
  • Updated: translations

1.0


wordpress thumbnails
10 Best WordPress Thumbnail Plugins to Manage Images Perfectly

Image thumbnails are very important part of any website, and they make your site look attractive and extremely professional. But, it's important to have good, perfectimage thumbnail with proper size and quality.

Though most of the new age WordPress theme comes with built in thumbnail generation system and shows the featured image perfectly; there are a number of themes which needs external support to show the thumbnail properly.

Post Thumbnails is a theme feature introduced with Version 2.9 of WordPress. It was quickly changed to Featured Images with Version 3.0. Post Thumbnail

The featured image thumbnail can attract your user's attention easily and keep them engaged on your site. So, it's really important that your take this parameter of your site seriously and show the perfect thumbnail.

WordPress comes with built in system to generate certain image sizes. However, you will need the support of thumbnail plugins to generate different sizes of your images at times.

Also, when you change the theme of your site, you will have to regenerate the thumbnail sizes because the image sizes are different for different themes and your old image size may not fit perfectly with the new design.

Here in this post, we have collected some of the best image thumbnail plugins for WordPress which will take care of all the aspects related to your featured image thumbnail and make your site look attractive and professional.

Top Thumbnail Plugins

Auto Post Thumbnail PRO

A comprehensive thumbnail manager for your WordPress site, this plugin offers you a number of features and options to help you create a beautiful thumbnail.

This plugin will automatically generate the featured image thumbnail from the first image available in a post or any custom post type.This plugin can also create thumbnails from several popular Video services if it finds a Video embedded in the post.

If there is no image in a post, it will generate a thumbnail from the first attached image of the post, and it will not do any change to the readily available thumbnail.

This plugin also comes with a free version which you can download here.

auto-post-thumbnail

Demo ThemeDownload Theme

Post-Thumbnail Editor

Different themes come with different thumbnail sizes, and they crop the images randomly, and sometimes your cropped images look ugly, or the cropping system cuts the important part of the image.

This plugin offers you to manage and edit your images perfectly; this plugin attempts to give the users an interface to manually fix those thumbnail and random images.

Post Thumbnail Editor

Demo ThemeDownload Theme

Video Thumbnails

Video sites often land into a problem with the image thumbnails because the built in a system doesn't generate any thumbnail from the attached videos.

This plugin comes to your rescue andautomatically display video thumbnails in your template. When you publish a post, this plugin will find the first video embedded and retrieve a thumbnail for you.

This plugin also supports custom post and custom fields.

Video Thumbnails

Demo ThemeDownload Theme

Dynamic Featured Image

Dynamic Featured Image is another useful thumbnail plugin for WordPress that will help you to generate multiple featured images within a post or page. This is especially helpful when you use other plugins, post thumbnails or sliders that use featured images.

Dynamic Featured Image

Demo ThemeDownload Theme

External URL To Post Thumbnail

With this plugin, you can set any external image as your featured image. You will just need to the URL of the image, and that will help you to save the image in your WordPress media library and set it as featured image for your post.

External URL To Post Thumbnail

Demo ThemeDownload Theme

Force Regenerate Thumbnails

An extremely important thumbnail plugin for WordPress, this plugin will help you regenerate the correct image sizes when you change your WordPress theme.

It's a must use plugin right after you change your theme, once you install a new theme you should install this plugin and regenerate all the image again to fit perfectly in the new theme.

Force Regenerate Thumbnails

Demo ThemeDownload Theme

Facebook Thumb Fixer

If you are struggling with your images while sharing posts on Facebook or Google+, this plugin will help you to resolve that issue.

This plug-in is for those who have the problem where sharing a post on Facebook or Google+ shows the wrong (or no) thumbnail image.

Facebook Thumb Fixer

Demo ThemeDownload Theme

Recent Posts Widget With Thumbnails

WordPress comes with a default recent post widget, but that doesn't show the post thumbnail. And if you want to make that widget more attractive with thumbnails of the posts you can use this plugin.

This plugin enhances the default WordPress recent post widget to show the featured image attached to the post. It doesn't have any complicated settings, just install and drag the widget to the sidebar.

Recent Posts Widget With Thumbnails

Demo ThemeDownload Theme

Thumbnail Upscale

If your image sizes are small, this plugin will help you to upscale your images and make it perfectly fit your required thumbnail size.

This plugin corrects that and upscales small images to the specified thumbnail dimensions. This is beneficial in grid layouts where images of different sizes can make the grid malfunction.

Thumbnail Upscale

Demo ThemeDownload Theme

Thumbnail Crop Position

WordPress crops the image thumbnails through the center, which does not always give us the desired results and it can cut important part of your images. This plugin will resolve the issue by providing you an option to select the crop position for your images.

Thumbnail Crop Position

Demo ThemeDownload Theme

10 Best WordPress Thumbnail Plugins to Manage Images Perfectly5 (100%) 1 vote

Crop-Thumbnails

Description

The plugin provides the functionality to adjust the crop region of cropped images. It add buttons to the edit-pages and media-dialog to access a crop-editor.
In the crop-editor you can choose one or more (if they have the same ratio) imagesizes and cut-off the part of the image you want.

The plugin is especially useful for theme developers who want to keep full control over cropped image sizes. If you want to dive even deeper, you can get informations about the hooks and filters on the github page of the plugin.

Screenshots

  • You have access to the crop-editor on the media-panel by clicking "Crop Featured Image".
  • Choose one or more images (with the same ratio).
  • The crop-editor is also integrated in the list-view of the media library.
  • Choose what image-sizes should be hidden (for what post-types), for better usability.
  • Quicktest on settings-page, to check if your system is correct setup.

Installation

You can use the built in installer and upgrader, or you can install the plugin manually.

You can either use the automatic plugin installer or your FTP program to upload it to your wp-content/plugins directory the top-level folder. Dont just upload all the php files and put them in /wp-content/plugins/. Activate the plugin through the Plugins menu in WordPress Configure any settings from Settings > Crop-Thumbnails. Use it.

FAQ

How to define cropped image sizes?

The plugin do not add additional image sizes, it only provides functionality to edit the crop area.

You can use add_image_size inside your functions.php to add additional cropped image sizes. See add_image_size documentation.

add_action( 'after_setup_theme', 'my_adjust_image_sizes' );
function my_adjust_image_sizes() {
    //add an cropped image-size with 800 x 250 Pixels
    add_image_size( 'my-custom-image-size', 800, 250, true );


    /** 
     * The following image sizes use a dynamic value.
     * USE WITH CARE
     * Also the plugin supports these image-sizes, i do not recommend them!
     **/
    //a dynamic cropped image size with 500 pixel height and the width of the original image
    add_image_size( 'my-dynamic-width-1', 9999, 500, true );

    //a dynamic cropped image with the same ratio as the original image and 500 pixel width
    add_image_size( 'my-dynamic-zero-height-1', 500, 0, true );
}

After you add the image-size any futher image uploads will produce a cropped image my-custom-image-size which you can use in post-loop:

if ( has_post_thumbnail() ) { 
    the_post_thumbnail( 'my-custom-image-size' ); 
}
What internal rules the plugin use for cropping?
  • The plugin will only crop image-sizes where crop is set to true (hard crop mode see: https://codex.wordpress.org/Function_Reference/add_image_size).
  • If you had set one image dimension in add_image_size() to 0, the plugin will crop it in the ratio of the original image.
  • If you had set one image dimension in add_image_size() to 9999, the plugin will change the 9999 to the actual size of the current original image.
  • You are able to crop all images with the same ratio at once (default) or and any imagesize (and ratio) seperate.
How to use this plugin on ACF taxonomy-images

The Adavanced Custom Fields plugin has a functionality to add images to taxonomies. To add cropping functionality on these images you have to add a small code-snippet to your functions.php
Have a look on the github readme-page for details.

Ive cropped the image, but the new version do not appear in the frontend.

If you had viewed your image on the site before, your browser has cached the image. You can hard refresh the page by hitting:
* CTRL + F5 (on Windows)
* Apple + R or command + R (on Mac/Apple)

Is it possible to crop an non-cropped image-size?

No. The purpose of this plugin is to provide control for the wordpress automatic crop. If you want to crop lets say the full-size image you should

  • a) upload it in a better format in the first place
  • OR b) use the Standard WordPress-Image editor to crop the image.
Where can I get developer information?

A documentation with a list of all actions and filters can be found on the Github page of the project.

I have two image-sizes that have nearly the same ratio. I want to make use of the feature Crop all images with same ratio at once, but cause the ratios are slightly different they wont be selected together.

You can add the following filter in the functions.php of your theme to adjust the ratio of one or more specified image-sizes.
CAUTION: use only when the ratios are really close.

add_filter( 'crop_thumbnails_editor_printratio', 'my_crop_thumbnails_editor_printratio', 10, 2);
function my_crop_thumbnails_editor_printratio( $printRatio, $imageSizeName) {
    if($imageSizeName === 'strange-image-ratio') {
        $printRatio = '4:3';//do override ratio
    }
    return $printRatio;
}
I display the cropped image in the backend in an custom meta-box. It does not update after the modal-dialog closed. Is there a way to fix this

Yeah, there is a way. After the crop-thumbnails-modal closed it triggeres a jаvascript event on the body element. You could use jQuery to cache-break your cropped thumbnail (in backend-view).
The event called cropThumbnailModalClosed. The plugin also provides a global function that could be called (only in post-edit-view and mediathek) to do the cache-break.
Example-Code:

$('body').on('cropThumbnailModalClosed',function() {
    CROP_THUMBNAILS_DO_CACHE_BREAK( $('.your-image-selector') );
});
What languages are supported?

You may have a look on the Translation Page.

I want to contribute code.

Fantastic, i published the code on github. But be warned, i am carefully evaluate new features.

If you fork and planning to publish the forked plugin, please contact me.

Reviews

The default cropping does a decent job, but it often misses things and this plugin is EXACTLY what I was looking for. Thank you! Plugin is perfect and its so easy to use. very useful plugin for my purpose, WordPress was cutted my model's head, but with this plugin I had option to choose best part of image. ?? I needed a plugin to manually crop each Woocommerce thumbnail. This plugin made it perfectly and it's so easy to use. In comparation with other plugins it works perfect. Brilliant and very needed plugin. Read all 50 reviews

Contributors & Developers

Crop-Thumbnails is open source software. The following people have contributed to this plugin.

Contributors
  • Volkmar Kantor

Crop-Thumbnails has been translated into 2 locales. Thank you to the translators for their contributions.

Translate Crop-Thumbnails into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.2.4

  • change the enqueue-name of the vue.js-library provided with the plugin to cpt_vue to make it possible to prevent this specific include
  • update js-dev dependencies
  • add the filter crop_thumbnails_filename to make it possible to change the target path/filename (thanks to https://github.com/matzeeable)
  • improve readme

1.2.3

  • fix a php-notice displayed on the settings-screen

1.2.2

  • fix calling a non static function in a static statically (fixes a bug where the plugin do not run locally)

1.2.1

  • fix a jаvascript-bug that occurs in WordPress 4.9.2 in relation with yoast seo-plugin

1.2.0

  • the used cropping data are now stored in the image after the crop, making it possible to code a plugin for restoring the cropped region on new image-sizes
  • fix for hiding crop sizes is not working when the image_size_names_choose-filter is used for that post-type
  • change permission from upload_files to edit_files (Attention: authors will no longer able to crop the thumbnails)
  • add a filter function to override the permission to crop thumbnails (crop_thumbnails_user_permission_check)
  • add settings-section to set if users can crop thumbnails with capability edit_files or upload_files
  • get featured image panel button working in wordpress v5

1.1.3

  • add a filter (crop_thumbnails_activat_on_adminpages), for adding the plugins js/css on futher admin-pages like the taxonomy edit-page.
  • update js and webpack dependencies

1.1.2

  • add an css-class on the listing of image-sizes

1.1.1

  • bugfix change use of mime_content_type() to wp_check_filetype() it seems on some servers mime_content_type() is undefined

1.1.0

  • bugfix variable was used but not defined (php)
  • bugfix image-size with custom name where not updated in view after crop
  • bugfix all same image-sizes where selected, even if they are not visible
  • in the settings-panel, add more quick-test informations
  • redesign settings-panel
  • make selected image-sizes more clear
  • optimize development-build-process
  • add warning sign for not yet cropped images-sizes

1.0.3

  • fix js error handling
  • add warning to the backend if the script cant connect the server
  • fix where escape of language-strings make no sense (exceptions in save.php)

1.0.2

  • improve i18n
  • change language text domain from cpt_lang to crop-thumbnails
  • rename language files to match text domain exactly
  • change CROP_THUMBS_VERSION to CROP_THUMBNAILS_VERSION
  • correct translations of the plugins name

1.0.1

  • fix code that mess with old php versions

1.0.0

  • modal dialog rewritten
  • crop functionality refactored
  • changed the crop-library for improved touch support
  • the action crop_thumbnails_modal_window_settings is gone, you can adjust style by override admin-css
  • the filter crop_post_thumbnail_window_css is gone, you can adjust style by override admin-css
  • adjusting dialog style make it more responsive
  • reviewed dynamic sizes: sizes with 9999 will no longer have ratio of the original image
  • reviewed dynamic sizes: filenames will no longer be changed
  • fix image-metadata polution
  • refactoring and cleanup a lot of the code
  • change from a language constant to cpt_lang
  • secure translations

0.10.15

  • bugfix: use wordpress-function to determine mime-type, as some servers do not define mime_content_type (Thank you Eskil Keskikangas for the submission)

0.10.14

  • bugfix: add mime-type to image-metadata (the mime-type was deleted by crop-thumbnails before unintentional)

0.10.13

  • bugfix: filter-settings will work again in media-dialog

0.10.12

  • add italian translation (thanks to akteon18)

0.10.11

  • bugfix: hide disabled image-sizes in the crop-editor again

0.10.10

  • bugfix: Checks if the current page have a featured image box in the first place

0.10.9

  • bugfix: click on the button in the featured image box (WP 4.6 and above)
  • button in featured image box is no longer visible if no image is choosed
  • minor style improvements

0.10.8

  • change empty-array-definition to be compatible with old PHP-Versions (prior 5.4)

0.10.7

  • fix a behaviour where the image_size_names_choose-filter could remove image-sizes from the settings page
  • add a seperate filter crop_thumbnails_image_sizes to remove/adjust image-sizes used by the plugin (use carefully)
  • use DIRECTORY_SEPARATOR in the save-function
  • add a quicktest to the settings screen

0.10.6

  • improve the bugfix of 0.10.5 (sorry for that)

0.10.5

  • bugfix: proper handling of non latin characters in filenames

0.10.4

  • i18n of the button in the image-media-view changed
  • add medium_large size to (intern) default-sizes (fix notice)
  • add action-hook crop_thumbnails_after_save_new_thumb after save the new thumbnail
  • add filter-hook crop_thumbnails_before_update_metadata before update metadata
  • add filter-hook crop_thumbnails_editor_jsonDataValues in the editor, to adjust dataValues
  • add filter-hook crop_thumbnails_editor_printratio in the editor (see F.A.Q. for details of usage)

0.10.3

  • small language adjustments

0.10.2

  • make the modal-dialog more robust against css-overriding of other plugins

0.10.1

  • small enhancement for developers: add the same_ratio_active parameter in the ajax-request (https://wordpress.org/support/topic/return-same-ratio-daja-in-ajax-request)

0.10.0

  • refactoring some parts of the code to make it more modular
  • adding a cache breaker to the backend, so in post-view and mediathek the image should be refreshed after the modal-dialog closes
  • provide a jаvascript-event (cropThumbnailModalClosed) after the modal is closed (see F.A.Q. for details)
  • provide the human-readable Name of the Crop-Size (if available), using the image_size_names_choose filter
  • provide some size settings for the modal-dialog via filter crop_thumbnails_modal_window_settings
  • mini language update

0.9.0

  • add crop-thumbnail-button to the default attachement-screens so i could accessed better
  • change modal-dialog from thickbox to ui-dialog
  • fix the missing crop-thumbnail-button in the attachment-list-view

0.8.4

  • fix a bug that may occure on some systems with xdebug enabled and low xdebug.max_nesting_level (see: https://wordpress.org/support/topic/error-when-trying-to-crop-a-certain-image)
  • add dutch language (thanks to Max Gruson)

0.8.3

  • fix a bug for systems with comma as dezimal seperator (https://wordpress.org/support/topic/doesnt-save-the-cropped-image-anywhere?replies=12#post-4563377)
  • reduce capabilities from edit_pages AND upload_files to only upload_files
  • more informations logged in the console if an error occurs while saving

0.8.2

  • add filter for customize the style of the crop-thumbnail content (crop_post_thumbnail_window_css)
  • add a fix for dynamic height/width images (https://wordpress.org/support/topic/dynamic-widthheight)
  • add ukrainian language (thanks to Jurko Chervony from www.skinik.name)

0.8.1

  • fix warning: when settings are saved

0.8.0

  • change Constant from CPT_VERSION to CROP_THUMBS_VERSION
  • bug fix: wrong calculated scale in the cpt-crop.js (selection will again always fill the maximum space)
  • change behavior: on landscape-ratio-images the selection will be initial in the middle of the image (portrait-ratio-images stay the same i asume that portrait-ratio images are mostly portraits)
  • add current jcrop (version v0.9.12) directly into the plugin to get rid of the subversion of cpt-crop.js for an prior version of jcrop in wordpress 3.4
  • add settings-option to display debug (js and/or data)
  • handle image-sizes with zero width or height
  • fix notices: not set variables
  • fix warnings: if an image-size is zero

0.7.2

  • bug fix: change the way the link in the featured Image-Box is set
  • languages: some adjustments

0.7.1

  • add language: brazilian portuguese (pt_br)
  • bug fix: fixes for the upcoming WordPress 3.5
  • bug fix: in crop editor, if an original image is larger than a single selected image-size, the predefined selection will now be on maximum possible size
  • bug fix: ensure that other plugins can?t add styles and scripts into the crop-thumbnail-iframe

0.7.0

  • workflow-enhancement: change the way the plugin handled same image-ratios (faster editing and less warnings)
  • the image-size with the biggest dimensions now is used for the min-boundaries (jcrop)
  • if the min-boundaries (jcrop) are bigger than original image the min-boundaries turned off

0.6.0

  • add a settings link in the plugin-listing
  • add a support-author area in the settings
  • update language files
  • Fix the readme-file for correct display informations on wordpress.org
  • add screenshots for wordpress.org
  • add license.txt

0.5.0

  • Initial Version
Set post thumbnail as background - WordPress Development Stack Exchange

I have a single page for my products where all products get listed. This is how i've archieved it:

  • 'produkte', 'posts_per_page' => 30 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); echo '
  • '; echo ''; echo ''; the_title('

    ', '

    '); if (has_post_thumbnail()) { echo '
    "; } echo ''; echo ''; echo ''; endwhile; ?>

I decided that i want to set the post thumbnail as the background-image of the li.produkt. When i do something like this:

echo '
';

The page generates an image-element above the li-element. What am i doing wrong??

3 Answers

The problem here is the_post_thumbnail() doesn't return image url but the img tag.

You can use this code

$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
echo '
';
Did you like the video? Like or tell your friends!
Tags:
Comments
Add a comment
Related videos:
16.08.2019
When I open my video folder, the thumbnails aren't showing. Instead, the default VLC icon was being displayed. Other
14.08.2019
Thumbs.com serves as a thumbnail gallery post that brings you a wide variety of porn thumbs. You will be
26.07.2019
Thumbs.com serves as a thumbnail gallery post that brings you a wide variety of porn thumbs. You will be
13.06.2019
This project is being deprecated because Amazon's AWS Alexa Site Thumbnail service is being deprecated. A jаvascript module built
10.06.2019
All custom thumbnail images must follow our Community Guidelines. Selecting a thumbnail that shows nudity or sexually provocative content, is
08.06.2019
Another way, which I use, is to link each thumbnail to a single page, saypicture.html. When linking, parameters are
select background