Skip to content

Instantly share code, notes, and snippets.

@marklchaves
Last active July 13, 2021 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marklchaves/8cfd5fb9784250b537e8bb2c486fb433 to your computer and use it in GitHub Desktop.
Save marklchaves/8cfd5fb9784250b537e8bb2c486fb433 to your computer and use it in GitHub Desktop.
Override Ashtabula Settings
/**
* Keep the image and the text stacked for
* all display widths.
*/
.swiper-slider-plugin__section {
display: flex;
align-items: center;
justify-content: center;
}
.swiper-slider-plugin-flex-card {
width: 90%;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-evenly;
margin: 0 auto; /* Needed for Avada. */
}
.swiper-slider-plugin-flex-card__text, .swiper-slider-plugin-flex-card__image {
width: 95%;
}
.swiper-slider-plugin-flex-card__text {
text-align: left;
padding: 1%;
}
.swiper-slider-plugin-flex-card__image {
background-size: contain;
background-repeat: no-repeat;
background-position: center;
height: 300px;
}
@media (min-width: 768px) {
.swiper-slider-plugin-flex-card__image {
height: 525px;
}
}
@media (min-width: 1024px) {
.swiper-slider-plugin-flex-card__image {
height: 800px;
}
}
/**
* Make the slides:
* 1. Slide horizontally.
* 2. Loop instead of rewind.
* 3. Manually swipe or click on nav arrows.
*/
(function () {
const swiper = new Swiper(".swiper-container", {
direction: "horizontal",
loop: true,
// If we need pagination
pagination: {
el: ".swiper-pagination",
},
// Navigation arrows
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
});
})();
<?php
/** Override Ashtabula Slider Plugin JS */
function override_ashtabula_js()
{
wp_dequeue_script('ashtabula');
wp_enqueue_script('ashtabula-custom-js', get_stylesheet_directory_uri().'/js/ashtabula-custom.js', '', '1.0.0', true);
}
add_action('wp_enqueue_scripts', 'override_ashtabula_js', 100);
/** Override Ashtabula Slider Plugin CSS */
function override_ashtabula_css()
{
wp_dequeue_style('ashtabula-plugin');
wp_enqueue_style('ashtabula-custom-css', get_stylesheet_directory_uri().'/css/ashtabula-custom.css', '', '1.0.0', 'all');
}
add_action('wp_enqueue_scripts', 'override_ashtabula_css', 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment