Updated on February 11, 2020

This members-only tutorial provides the steps to write a custom WordPress query to pull the featured image and title of posts linking to their permalinks and display them as a slider with partial slides appearing on either side using Swiper.

Note: It is not currently possible to have more than 1 slide move at a time with Swiper.

If you need this functionality look into alternatives like Owl or Slick.

Step 1

Let's load Swiper in the Oxygen editor and on the front end.

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.min.css to plugin's assets/css directory.

Upload swiper.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 );


This is a premium members-only content.

To view the rest of the content, please sign up for membership ($37/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?


Find the article helpful and wish to donate?



For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.

9 comments on “Custom slider with a partial view in Oxygen using Swiper”

    1. Yes.

      In the custom functionality plugin change wp_enqueue_script to wp_localize_script.

      Then in the Reusable Part, inside the Code Block before you initialize Swiper enqueue it like so:

      wp_enqueue_script( 'swiper' );
  1. the slider shows only 3 images each time ( i changed size to 800 x 530 but this should not be the reason i guess ), i see in the css swipe-slide width 29%, is this the place to edit for more slides to appear in a row?

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: