PMC Listicle Gallery v2
Overview
This plugin defines and handles the post types required for creating a "listcle gallery" post.
A listicle gallery consists of:
- an intro page containing a featured image, title, dek, and content with optional embedded videos and images.
- a collection of one or more
listicle gallery itemposts.
A listicle gallery item consists of:
- title, dek, and content with optional embedded videos and images.
- an image carousel
Each listicle gallery item has links to the previous and next listicle gallery item posts.
How to install the plugin
This plugin is automatically available to themes that use the pmc-core master theme.
For other themes, use load_pmc_plugins to load pmc-listicle-gallery-v2.
Replacing the default css files
Your theme can use the following filters to provide its own css and js files for this plugin:
To override the css file for Listicle Gallery:
add_filter( 'pmc_listicle_gallery_v2_gallery_css', function () {
return 'path-to-your-css-file';
} );To override the css file for Listicle Gallery Item:
add_filter( 'pmc_listicle_gallery_v2_gallery_item_css', function () {
return 'path-to-your-css-file';
} );Overriding the default settings
You can use the following filter to override the default Listicle Gallery Item settings:
add_filter( 'pmc_listicle_gallery_v2_gallery_item_settings', function () {
return $settings;
} );where $settings is an associative array with the following keys:
slide_width - width of each slide image
slide_height - height of each slide image
thumb_width - width of each thumbnail
thumb_height - height of each thumbnail
thumbs_count - number of thumbnails to show
Image aspect ratio
The default aspect ratio for the slides is 1.77
If you are overriding the default settings, make sure your images have an aspect ratio that reflects the new settings.
Overriding the in-body ad
By default, the in-body ad is set to right-rail-2 for the Listicle Gallery and Listicle Gallery Item pages. You can use the following filters to specify a different PMC Ad Manager location.
To override the Listicle Gallery in-body ad:
add_filter( 'listicle_gallery_override_body_ad', function () {
return 'your-ad-location';
} );To override the Listicle Gallery Item in-body ad:
add_filter( 'listicle_gallery_item_override_body_ad', function () {
return 'your-ad-location';
} );To build
npm install - Install all necessary modules.
npm run watch - Watch the src folder for changes and build uncompressed assets. Use this for development and debug, but always run npm run build to compile production code after.
npm run build - Build SCSS and JS files with minification for deployment to production. Always run this prior to pushing your branch to origin if CSS or JS changes are included.