Skip to content

Instantly share code, notes, and snippets.

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

Kharis Sulistiyono kharissulistiyo

🏠
Working from home
View GitHub Profile
@kharissulistiyo
kharissulistiyo / block.js
Created January 6, 2020 23:39
Save block depending on its settings
save: function( props ) {
var attributes = props.attributes;
return(
el( 'div', { className: props.className },
el( 'p', {}, i18n.__( 'Card block is here', 'risbl-card-block' ) ),
// Other HTML elements goes here
)
);
@kharissulistiyo
kharissulistiyo / block.js
Created January 6, 2020 23:37
Block settings in edit() function
edit: function( props ) {
var attributes = props.attributes;
return(
el( 'div', { className: props.className },
el( 'p', {}, i18n.__( 'Card block is here', 'risbl-card-block' ) ),
// Other HTML elements goes here
)
);
@kharissulistiyo
kharissulistiyo / block.js
Created January 6, 2020 23:14
Kharis Sulistiyono: Basic block.js
/**
*
* To do:
* formatting on the screen so it's not all bunched
* options for various outputs
* styling
*
*/
( function( blocks, editor, i18n, element, components, _ ) {
var el = element.createElement;
@kharissulistiyo
kharissulistiyo / gist:0f642726586d6b9fc07edcdc5c211405
Created August 3, 2019 09:04 — forked from CristinaSolana/gist:1885435
Git command: Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@kharissulistiyo
kharissulistiyo / script.js
Created December 14, 2017 12:06
Sydney Pro: JS code to move default WC menus location.
;(function($) {
'use strict'
if( $('.header-contact-info').length ) {
var cartMenu = $('.mainnav .nav-cart');
var accountMenu = $('.mainnav .header-account');
$('.header-contact-info').prepend('<ul class="header-contact-menu"></ul>');
@kharissulistiyo
kharissulistiyo / snippet.php
Created August 25, 2016 13:52
Incorrect category link
//Check if category exists and echo it
if($category) {
echo '
<li>
<i class="fa fa-tags"></i>
<a href="'.esc_url($category[0][1]).'">'.esc_html($category[0][2]).'</a>
</li>';
}
@kharissulistiyo
kharissulistiyo / custom.css
Created August 20, 2016 17:50
Custom CSS
@media only screen and (max-width:1280px){
#mainnav{
display: none;
}
.btn-menu{
display: block;
}
@kharissulistiyo
kharissulistiyo / main.js
Created August 20, 2016 17:49
JS mobile menu
if ( matchMedia( 'only screen and (max-width: 1280px)' ).matches ) {
currMenuType = 'mobile';
}
@kharissulistiyo
kharissulistiyo / main.js
Created August 20, 2016 17:48
JS mobile menu
if ( matchMedia( 'only screen and (max-width: 1024px)' ).matches ) {
currMenuType = 'mobile';
}