Skip to content

Instantly share code, notes, and snippets.

@Dias25
Dias25 / get_jewish_date.php
Created July 23, 2025 06:54
Get Jewish Date php
if (!extension_loaded('calendar')) {
die("Need extension PHP Calendar");
}
// Текущая дата
$day = date('d');
$month = date('m');
$year = date('Y');
// Конвертируем в юлианский день
@Dias25
Dias25 / js
Created July 18, 2021 16:06
Slider revolution stop rotate on click
revapi1.bind("revolution.slide.onloaded",function (e) {
revapi1.click(function() {
var clicks = jQuery(this).data('clicks');
if (clicks) {
// alert('play');
revapi1.revresume();
} else {
// alert('pause');
revapi1.revpause();
}
@Dias25
Dias25 / email-styles.php
Last active December 31, 2019 11:59
Customer order details mob responsive (woocommerce)
#template_container, #template_header_image, #template_header, #template_body, #template_footer {
width:100% !important;
max-width:600px !important;
min-width:320px !important;
}
#wrapper {
max-width: 600px !important;
margin: 0 auto !important;
padding: 0 !important;
}
@Dias25
Dias25 / function
Created April 1, 2019 16:47
woocommerce search open product page only one result
//remove
add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );
@Dias25
Dias25 / script
Created September 25, 2018 10:13
Fotorama and elevatezoom
$(document).ready(function() {
if ($(window).width() > 767) {
$('.fotorama').on('fotorama:load', function (e, fotorama, extra) {
// console.log(extra);
$('.fotorama__stage__shaft .fotorama__active > img').attr('id','zoomit');
$('#zoomit').elevateZoom();
});
$('.fotorama').on('fotorama:showend', function (e, fotorama, extra) {
// console.log(extra);
$('.fotorama__stage__shaft .fotorama__stage__frame > img').attr('id','');
@Dias25
Dias25 / get id category CPT
Last active March 20, 2018 09:21
Получить id категории в записи (Custom post type)
/***** В записях у которых категория или род. категория имеет id 26 выводит black.css. ******/
/***function.php****/
if (is_singular('product')){
global $post;
$term = wp_get_post_terms( $post->ID, 'catalog');
$term_id = $term[0]->term_id;
$term_parent = $term[0]->parent;
if ($term_parent == 26 || $term_id == 26 ){
wp_enqueue_style( 'ctk-black', get_template_directory_uri() . '/css/black.css' );
@Dias25
Dias25 / yoast_seo_breadcrumb_remove_link.php
Created March 12, 2018 20:02 — forked from amboutwe/yoast_seo_breadcrumb_remove_link.php
Remove a link from the Yoast SEO breadcrumbs site wide.
@Dias25
Dias25 / button.sass
Created February 22, 2018 12:14 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
Keymap (Windows Users):
[
{ "keys": ["alt+shift+f"], "command": "reindent" },
]
Settings:
{
"show_definitions": false,
"auto_complete": false,
"bold_folder_labels": true,