Updated on September 27, 2020.
This members-only tutorial provides the steps to output images uploaded to ACF Pro's Gallery field attached to a CPT in the markup needed for Swiper's thumbnail gallery on the post type's single pages.
Step 1 (optional)
Use a plugin like CPT UI to create your desired custom post type.
The name of the CPT in this example is property
.
Step 2
Install and activate Advanced Custom Fields Pro.
Create a field group having a gallery type field and attach the group to your post type.
The name of the custom field in this example is property_gallery
.
Step 3
Let us load Swiper jQuery library on single property entries in the Oxygen editor and on the
Install and activate My Custom Functionality plugin.
Connect to your hosting account using a FTP client and navigate to site's /wp-content/plugins/my-custom-functionality-master
directory.
Upload swiper-bundle.min.css to plugin's assets/css
directory.
Upload swiper-bundle.min.js to plugin's assets/js
directory.
Edit plugin.php
and replace
add_action( 'wp_enqueue_scripts', 'custom_enqueue_files' );
/**
* Loads <list assets here>.
*/
function custom_enqueue_files() {
// if this is not the front page, abort.
// if ( ! is_front_page() ) {
// return;
// }
// loads a CSS file in the head.
// wp_enqueue_style( 'highlightjs-css', plugin_dir_url( __FILE__ ) . 'assets/css/style.css' );
/**
* loads JS files in the footer.
*/
// wp_enqueue_script( 'highlightjs', plugin_dir_url( __FILE__ ) . 'assets/js/highlight.pack.js', '', '9.9.0', true );
// wp_enqueue_script( 'highlightjs-init', plugin_dir_url( __FILE__ ) . 'assets/js/highlight-init.js', '', '1.0.0', true );
}
with
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $599 one-time).
Already a member? Log in below or here.