Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Hossein Karami HosseinKarami

View GitHub Profile
@HosseinKarami
HosseinKarami / storefront-custom-homepage-shortcode-section.php
Last active Jan 15, 2018 — forked from stuartduff/storefront-custom-homepage-shortcode-section.php
Add a custom shortcode section to the storefront themes homepage template.
View storefront-custom-homepage-shortcode-section.php
function sf_output_custom_shortcode_section() {
echo '<section class="storefront-product-section storefront-product-category">';
echo '<h2 class="section-title">' . __( 'Music Category', 'storefront' ) . '</h2>';
echo do_shortcode( '[product_category category="music" columns="4" per_page="4"]' );
echo '</section>';
@HosseinKarami
HosseinKarami / Eng_Number_to_Persian.js
Last active Sep 9, 2017
English Number to Persian
View Eng_Number_to_Persian.js
$(document).ready(function(){
persian={0:'۰',1:'۱',2:'۲',3:'۳',4:'۴',5:'۵',6:'۶',7:'۷',8:'۸',9:'۹'};
function traverse(el){
if(el.nodeType==3){
var list=el.data.match(/[0-9]/g);
if(list!=null && list.length!=0){
for(var i=0;i<list.length;i++)
el.data=el.data.replace(list[i],persian[list[i]]);
}
}
View html5boilerplate.jade
!!! 5
html(class='no-js')
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
title
meta(name='description', content='')
meta(name='viewport', content='width=device-width, initial-scale=1')
You can’t perform that action at this time.