Skip to content

ryanve/image_src

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

Social media sites often use the "image_src" microformat for displaying link thumbnails. This simple plugin adds the image_src rel value to the code of your site. By default, the plugin applies only to singular views and it uses the featured image. It only applies when an image is available.

Install

  1. Go to: WordPress > Plugins > Add New > and find "image_src"
  2. Activate via WordPress > Plugins > Installed Plugins

Requires: PHP 5.3+

Customize

The @image_src filter hook allows for image customization and/or extending the plugin to views without a featured image:

add_filter('@image_src', function ( $src = '' ) {
  return $src ? $src : '/example.png';
});

License: MIT

Copyright (C) 2013 by Ryan Van Etten

Releases

No releases published

Packages

No packages published

Languages