on Blogging

Image Extractor

Image extractor - plugin per wordpress


Image Extractor is a WordPress plugin that extract the first image from the post and display it. The "Image Extractor" main feature is the capability to resize the image found to a wanted size. The final image is cached in a folder, so you can obtain better performances.

How to install

  • Download the .zip file and extract it
  • Upload the extrated folder (imageExtractor/) to the WordPress plugins folder (wp-content/plugins/)
  • Configure the imageExtractor.php file and set the right cache folder. Make sure it’s writable.
  • Activate the plugin from the WordPress back office panel

How to use

Image Extractor will enable a new template function. It output a complete IMG tag to be inserted into your HTML code. The image source is retrieved from the first image found in the current post. Here is an example showing you how to use it:

<?php
  while (have_posts()) : the_post();
    image_extractor(true, 1, 395, 0, '', '', '<div>', '</div>');
    the_excerpt();
  endwhile;
?>

The syntax is:

  image_extractor($resize=false, $resize_type=1, $width='', $height='', $class='', $id='', $prefix='', $suffix='')

where:

  • resize: indicate if the plugin has to resize the image and store it in the cache folder
  • resize_type: there are 3 type of resizing:
    • 0 -> image will be resized to the new output size, regardless of the original aspectratio. (default)
    • 1 -> image will be cropped if necessary to preserve the aspectratio and avoid image distortions.
    • 2 -> image will be resized preserving its original aspectratio. differences to the new outputsize will be filled with white
  • width: the destination width. If resize is false, this property only add/change the WIDTH attribute of the IMG tag
  • height: the destination height. If resize is false, this property only add/change the HEIGHT attribute of the IMG tag
  • class: add or change the CLASS attribute of the IMG tag
  • id: add or change the ID attribute of the IMG tag
  • prefix: add a prefix to the resulting IMG tag
  • suffix: append a suffix to the resulting IMG tag

The resulting effect is cool! You can resize the post dimension as you want! Here is a screenshot!
PS: Wowww, WordPress staff has just approved my first plugin!!! I’m very very happy. You can find "Image Extractor" on the official WordPress plugin repository.resulting-effect-image-extractor

I commenti sono chiusi.

Webmention

  • Mahesh Ruparel

    […] ————————- often people just want to remove the first image in a post, with the above script, this is how. <?php ob_start(); the_content(‘Read the full post’,true); $postOutput = preg_replace(‘/]+./’,”, ob_get_contents(),1); ob_end_clean(); echo $postOutput; ?> —————————– <?php            $beforeEachImage = “<div>”;            $afterEachImage = “</div>”;            preg_match_all(“/(<img [^>]*>)/”,get_the_content(),$matches,PREG_PATTERN_ORDER);            for( $i=0; isset($matches[1]) && $i < count($matches[1]); $i++ ) {                  echo $beforeEachImage . $matches[1][$i] . $afterEachImage;            } ?> ——— http://www.dynamick.it/image-extractor-765.html […]

  • Image Extractor Plugin « WordPress Italy Forum

    […] sono nuova. Ho recentemente installato la versione 2.2 di wordpress. Ho qualche problema con questo plugin Ho provato ad inserire il codice nel template di default, nel file index.php, ma mi è risultato […]

  • - Blographik - Grafica, web Design e video editing

    posizionamento degli annunci di google è stata molto oculata, ha seguito in dettaglio la mappa termica che google stesso mette a disposizione per migliorare i propri introiti tramite la loro pubblicità. Da segnalare Image Extractor, l’utile plug in per wordpress realizzato da Michele Gobbi per dare maggiore rilievo alle immagini in quanto vengono estratte e ridimensionate a seconda delle proprie esigenze. Nella home di dynamik.it le immagini sono di piccole dimensioni, per

  • WordPress Francophone

    simple à prendre en main que les utilisateurs finaux vont *vraiment* utiliser qu’un workflow brutal comme celui de typo3 que l’on débranche 2 semaines après la mise en production parce que personne n’y comprend rien. ImageExtractor : (page plugin) [IMG ] Le plugin dont j’ai rêvé pendant un moment. Il permet de filtrer le contenu d’un post et d’en sortir la première image trouvée. Très utile pour faire des remontées de catégories en teasing sur votre page d

  • Labpress - Um site WordPress sobre WordPress

    Tools Combining Google Maps and Geotagged Photos” Dreamweaver Extension for WordPress (por Vikiwords) Extensão para o Dreamweaver que pode otimiza (muito) o trabalho na construção de Temas para o WordPress.WP Image Extractor PluginUm bom plugin para quem pensa em fazer do WordPress, o seu CMS. O Image Extractor Plugin promete automatizar uma tarefa só era possível com o uso dos custon-fieds. Ele pega a primeira imagem de seu post, redimenciona, guarda e exibe em sua

  • Labpress - Um site WordPress sobre WordPress

    Tools Combining Google Maps and Geotagged Photos” Dreamweaver Extension for WordPress (por Vikiwords) Extensão para o Dreamweaver que pode otimiza (muito) o trabalho na construção de Temas para o WordPress.WP Image Extractor PluginUm bom plugin para quem pensa em fazer do WordPress, o seu CMS. O Image Extractor Plugin promete automatizar uma tarefa só era possível com o uso dos custon-fieds. Ele pega a primeira imagem de seu post, redimenciona, guarda e exibe em sua

  • WordPress Plugin Database

    retrieved from the first image found in the current post. The “Image Extractor” main feature is the capability to resize the image found to a wanted size. The final image is cached in a folder, so you can obtain better performances. [Download] [Plugin Page]

  • Free Treasures for Designers

    you. Today it is personal blog of Italian web observer and programmer – Mike. If you don’t understand Italian you can use Google Language Tools (as I did). About a month ago I started to communicate with him about his wonderful Word Press plugin -Image Extractor(it can extract the first image from the post and display it). I’m sure this plugin has a great potential and someday I will install it to my blog, The next great thing is his new WP Plugin Related Post with Thumbnail