Skip to content

Creates an image of all of the featured images of all posts within a certain set of paraments in WordPress

Notifications You must be signed in to change notification settings

seanblankenship/create-image-from-post-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Create Image from Post Featured Images

Creates an image of rows and columns of all of the featured images of posts within a certain set of parameters in WordPress.

Options

There are the following options available at the top of the file to set some defaults. Always make sure to set the default post type that should be queried.

$config = array(
	'canvas_width'  => 1600, // final image width if not trimmed
	'canvas_height' => 1200, // final image height if not trimmed
	'columns'       => 7, // number of images per row
	'padding'       => 10, // space between images
	'max_images'    => 50, // keep this set to a reasonable number to prevent memory issues
	'default_type'  => 'POST_TYPE', // type must always bet set
	'default_tax'   => '', // optional
	'default_term'  => '', // optional
	'aspect_ratio'  => array( 3, 4 ), // width, height
);

Usage

Pass the file to an img src and attach taxonomy name, term name, and/or trim to the query string if you need to pass those options.

<img
    src="https://url/to/file/generate.php?tax=TAXONOMY&term=TERM&trim=true"
    alt="Composite of Featured Images" />

About

Creates an image of all of the featured images of all posts within a certain set of paraments in WordPress

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages