Skip to content

Instantly share code, notes, and snippets.

💭
Everyday Hard Working ...

Dimative dimative

💭
Everyday Hard Working ...
Block or report user

Report or block dimative

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dimative
dimative / guide.md
Created Mar 19, 2020 — forked from PJoy/guide.md
SAGE BARBA
View guide.md

Using barba.js with Sage starter theme

Barba.js is a library using pushState and AJAX allowing websites to load pages asynchronously while still maintaining browser states and history.

Combining it with some JavaScript animations libraries can help craft some memorable browsing experiences.

alt text source

In this guide, we will try to find an optimal way to integrate Barba with our beloved Sage theme !

View yoastseo-remove-breadcrumb-link.php
View yoastseo-add-breadcrumb-link.php
@dimative
dimative / elementor-category-posts-per-page.php
Created Sep 10, 2019 — forked from nicomollet/elementor-category-posts-per-page.php
Elementor: Force posts per page number for posts widget on Category Pages
View elementor-category-posts-per-page.php
<?php
/**
* Elementor: Force posts per page number for posts widget on Category Pages
*
* @param $query
*/
function elementor_category_posts_per_page( $query ) {
$category_id_or_slug = 'myslug';
@dimative
dimative / elementorcssinhead.php
Created Sep 10, 2019 — forked from nicomollet/elementorcssinhead.php
Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer
View elementorcssinhead.php
<?php
/**
* Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer
*/
function elementor_css_in_head(){
if(class_exists('\Elementor\Plugin')){
$elementor = \Elementor\Plugin::instance();
$elementor->frontend->enqueue_styles();
}
if(class_exists('\ElementorPro\Plugin')){
View polylang-langswitcher-shortcode.php
<?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 = '';
View elementor-template-polylang-translation.php
<?php
/**
* Elementor get polylang translation of template
*/
add_filter( 'elementor/theme/get_location_templates/template_id', function( $post_id ) {
if(!is_admin()){
if ( function_exists( 'pll_get_post' ) ) {
@dimative
dimative / woocommerce-sales-empty-cache.php
Created Sep 10, 2019 — forked from nicomollet/woocommerce-sales-empty-cache.php
WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket)
View woocommerce-sales-empty-cache.php
<?php
/**
* WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket)
*
* @since 1.0.9
*/
function woocommerce_scheduled_sales_empty_wprocket_cache(){
// Clear WP Rocket Cache (whole site)
if ( function_exists( 'rocket_clean_domain' ) ) {
@dimative
dimative / woocommerce_structured_data_product_brand.php
Created Sep 10, 2019 — forked from nicomollet/woocommerce_structured_data_product_brand.php
WooCommerce: Adds Brand attribute to "Product" Structured Data
View woocommerce_structured_data_product_brand.php
<?php
/**
* WooCommerce: Adds Brand attribute to "Product" Structured Data
*
* @param array $data
*
* @return array
*/
function woocommerce_structured_data_product_brand ($data) {
global $product;
@dimative
dimative / wpseo_schema_organization.php
Created Sep 10, 2019 — forked from nicomollet/wpseo_schema_organization.php
Yoast SEO Organization Schema Replaced By LocalBusiness
View wpseo_schema_organization.php
<?php
/**
* Add LocalBusiness to schema Organization
*
* @api array $data The graph piece to filter.
*
* @return array
*/
function custom_wpseo_schema_organization($data){
You can’t perform that action at this time.