Skip to content

Instantly share code, notes, and snippets.

View pehaa's full-sized avatar

Paulina Hetman pehaa

View GitHub Profile
@pehaa
pehaa / snippet.php
Last active March 3, 2023 13:39
jetpack_instant_search_options
add_filter( 'jetpack_instant_search_options', function($options) {
$lang = pll_current_language();
$options['adminQueryFilter'] = array(
'bool' => array(
'must' => array(
array( 'term' => array( 'taxonomy.language.slug' => $lang ) ),
)
)
);
.wc-bookings-date-picker-date-fields .required_for_calculation.booking_date_year {
width: auto;
min-width: 100%;
}
@pehaa
pehaa / patternCount.js
Last active January 9, 2023 05:50
CodePen Home Tartans Palette + Threadcount into an array of Stripes
const countPattern = (threadcount, palette, multiplier = 4) => {
// transforms pallette K#303030 W#FFFFFF string into an objet {K: '#303030', W: '#FFFFFF'}
palette = palette.split(" ").reduce((acc, curr) => {
const el = curr.split("#")
acc[el[0].trim()] = `#${[el[1]]}`
return acc
}, {})
@pehaa
pehaa / functions.php
Created August 11, 2019 11:47
Child theme functions.php
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
@pehaa
pehaa / custom.php
Last active August 11, 2019 11:31
Custom card notice
/* Add this snippet in your child theme functions.php file */
add_action( 'woocommerce_before_cart' , 'my_custom_cart_notice' );
function my_custom_cart_notice() {
wc_clear_notices();
wc_print_notice( 'My custom notice text comes here', 'notice' );
wc_clear_notices();
}
const pMap = require('p-map')
const axios = require('axios')
const https = require('https')
const camelCase = require('camelcase')
const { mapKeys, isPlainObject, trimEnd } = require('lodash')
const TYPE_AUTHOR = 'author'
const TYPE_ATTACHEMENT = 'attachment'
class WordPressSource {
@pehaa
pehaa / .css
Last active March 28, 2019 06:22
Additional css - gallery and fixed navigation with Astra
.wp-block-gallery img {
transition: 1s;
}
.wp-block-gallery:hover img {
transform: scale(.95);
filter: grayscale(100%);
}
.wp-block-gallery img:hover {
@pehaa
pehaa / .css
Created March 28, 2019 05:48
Add interaction to WordPress gallery block
.wp-block-gallery img {
transition: 1s;
}
.wp-block-gallery:hover img {
transform: scale(.95);
filter: grayscale(100%);
}
.wp-block-gallery img:hover {
<section class="band o-wrapper--48@desktop">
<div class="o-wrapper">
<div class="o-layout o-layout--center">
<div class="o-layout__item u-2/3@desktop">
<h2 class="u-center u-h3">Stay Tuned!</h2>
<p class="u-h4 u-h4--multiline">Want to be the first to learn about our new releases of Free Altphotos Lightroom presets? Join our newsletter!</p>
<form action="//altphotos.us14.list-manage.com/subscribe/post?u=667f63f5c02d84238a54fcca0&amp;id=22e2f89635" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate u-flex" target="_blank" novalidate>
<input type="email" class="input-group__input u-2/3 u-margin-right-small o-box--small required email" placeholder="Your email" name="EMAIL" id="mce-EMAIL" required="">
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
add_filter( 'ginger_login_link_visible', '__return_false' );
add_filter( 'phtpb_config_data', 'ginger_demo_phtpb_config_data' );
function ginger_demo_phtpb_config_data( $data ) {
$rev_sliders = array();
if ( class_exists( 'RevSlider' ) ) {