Skip to content

Instantly share code, notes, and snippets.

View temsool's full-sized avatar
🏠
Working from home

Mira temsool

🏠
Working from home
View GitHub Profile
@temsool
temsool / searchform.php
Created June 16, 2020 20:34 — forked from bramchi/searchform.php
Roots.io searchform.php template hack to get search widget working in Polylang, only searching within the active language. 'soil-nice-search' disabled btw.
<?php
/*
*
* Roots.io searchform.php template hack to fix Polylang search
*
* Note: Polylang setting 'Hide URL language info for default language' should be enabled for this to work.
* Soil-nice-search disabled in Roots.
*
*/
@temsool
temsool / polylang-langswitcher-shortcode.php
Created March 25, 2020 09:21 — forked from nicomollet/polylang-langswitcher-shortcode.php
Polylang shortcode for lang switcher
<?php
/**
* Polylang Shortcode - https://wordpress.org/plugins/polylang/
* Add this code in your functions.php
* Put shortcode [polylang_langswitcher] to post/page for display flags
*
* @return string
*/
function custom_polylang_langswitcher() {
$output = '';
@temsool
temsool / woo-pagination-arrows.php
Created December 18, 2019 19:28 — forked from danfisher85/woo-pagination-arrows.php
Change arrows for pagination (woocommerce)
<?php
add_filter( 'woocommerce_pagination_args', 'rocket_woo_pagination' );
function rocket_woo_pagination( $args ) {
$args['prev_text'] = '<i class="fa fa-angle-left"></i>';
$args['next_text'] = '<i class="fa fa-angle-right"></i>';
return $args;
}
@temsool
temsool / _spacing-helpers.scss
Created March 18, 2019 08:02 — forked from jacurtis/_spacing-helpers.scss
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
#target Illustrator
/*
Revision-1
Author: Shivendra Agarwal
Year: 2017
Title: Script to scale-up artwork and artboard above 15 Mpixel
*/
if ( app.documents.length > 0 )
alert("ERROR: \n Close all documents before running this script." );
@temsool
temsool / schema.php
Created October 5, 2018 21:13
Schema.org addtions for better SEO - Function for WordPress
/**
* Schema.org addtions for better SEO
* @param string Type of the element
* @return string HTML Attribute
*/
function get_schema_markup($type, $echo = false) {
if (empty($type)) return false;
/* Add Image Stretch Option Control to the Image Gallery Widget */
add_action( 'elementor/element/before_section_end', function( $element, $section_id, $args ) {
/** @var \Elementor\Element_Base $element */
if ( 'image-gallery' === $element->get_name() && 'section_gallery' === $section_id ) {
$element->add_control(
'image_stretch',
[
'label' => __( 'Image Stretch', 'elementor' ),
'type' => \Elementor\Controls_Manager::SELECT,
@temsool
temsool / margin-padding.less
Last active November 21, 2015 09:09 — forked from mucsher/margin-padding.less
Function Less: Margin and Padding Utilities Class
// Define Style Margin - Padding
.marginAndPadding(@iterations)
{
.p0 {padding: 0px;}
.pT0{padding-top: 0px;}
.pR0{padding-right: 0px;}
.pB0{padding-bottom: 0px;}
.pL0{padding-left: 0px;}
.m0 {margin: 0px;}