This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="product-gallery"> | |
<div id="splide-thumbnail" class="splide"> | |
<div class="splide__track"> | |
<ul class="splide__list"> | |
<li class="splide__slide" aria-label="Carousel item"></li> | |
<li class="splide__slide" aria-label="Carousel item"></li> | |
<li class="splide__slide" aria-label="Carousel item"></li> | |
</ul> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.vid-buttons{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:60px;height:60px;} | |
.play-pause-button{width:100%;height:100%;display:flex;border-radius:100%;background-color:#ffffff;justify-content:center;align-items:center;} | |
.play-pause-button>span{height:24px;} | |
</style> | |
<div class="vimeo-player" data-vimeo_id="<?php // vimeo video id ?>"></div> | |
<div class="vid-buttons"> | |
<a href="javascript:;" class="play-pause-button"> | |
<span class="play-icon"><?php echo icon_play('#000'); ?></span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( have_posts() ): | |
while( have_posts() ) : the_post(); | |
get_template_part( 'template-parts/content', get_post_format() ); | |
endwhile; | |
the_posts_pagination(array( | |
'mid_size' => 2, | |
'prev_text' => __('« Previous'), | |
'next_text' => __('Next »'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import requests, csv, time, lxml, cchardet, re | |
from bs4 import BeautifulSoup | |
import concurrent.futures | |
sitemap = '' # Sitemap URL | |
s = requests.session() | |
sm = s.get(sitemap) | |
sm_soup = BeautifulSoup(sm.text, 'lxml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Lazy Load All Images | |
* | |
* To Exclude, simply add this attr to img html: loading="not_lazy" | |
* | |
* @param string $html Post thumbnail HTML | |
* | |
* @return string Filtered post image HTML. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="owl-demo"> | |
<div class="slide-progress"></div> | |
<div class="owl-carousel owl-theme"> | |
<div class="item"> | |
<img src="http://placehold.it/850x350" alt="slide"> | |
</div> | |
<div class="item"> | |
<img src="http://placehold.it/850x350" alt="slide"> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Code from (https://www.codegrepper.com/code-examples/php/frameworks/yii/slug+to+string+php) | |
function slugify($text, string $divider = '-') { | |
// replace non letter or digits by divider | |
$text = preg_replace('~[^\pL\d]+~u', $divider, $text); | |
// transliterate | |
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header class="hdr_top"></header> | |
<style> | |
.hdr_top { position: fixed; top: 0; left: 0; right: 0; z-index: 2; transition: transform 0.4s; background-color: #000; } | |
.scroll-down .hdr_top { transform: translate3d(0, -100%, 0); } | |
.scroll-up .hdr_top { padding: 10px 0; } | |
</style> | |
<script> | |
// Sticky Header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('get_post_ids_by_meta_key_and_value')) { | |
function get_post_ids_by_meta_key_and_value($key, $value) { | |
global $wpdb; | |
$meta = $wpdb->get_results("SELECT post_id FROM `".$wpdb->postmeta."` WHERE meta_key='".$wpdb->escape($key)."' AND meta_value='".$wpdb->escape($value)."'"); | |
$post_ids = []; | |
foreach( $meta as $m ) { |
NewerOlder