Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

MWDelaney/acf-cover-media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Custom Fields Cover Media

NOTE: This plugin is very much a work in progress.

A WordPress plugin that provides Easy, consistent cover media fields for WordPress and ACF Pro 5.

Requirements

  1. WordPress 4.5+
  2. Advanced Custom Fields Pro 5

Usage

This plugin requires a small change to your theme:

Template Tag

Add the following template tag wherever you want cover images to appear in your theme:

<?php acfci_cover(); ?>

Recommended CSS

In order for the cover image to look right, its immediate parent should have something like the following css:

height: 100vh;

Layout Classes

Layout classes are added to the body tag and can be used to style the cover image in your theme's CSS

Change where the Cover Image fields appear

By cover images are enabled for Pages, to define which post types cover images should be available on, declare theme support:

 $landing_page_templates = array(
   array (
     array (
       'param' => 'post_type',
       'operator' => '==',
       'value' => 'page',
     ),
     array (
       'param' => 'page_template',
       'operator' => '!=',
       'value' => 'template-no-header-image.php',
     ),
   ),
 );
 add_theme_support( 'cover-image-location', $landing_page_templates );

About

Easy, consistent cover media fields for WordPress and ACF Pro 5.

Resources

License

Stars

Watchers

Forks

Packages

No packages published