Skip to content

Instantly share code, notes, and snippets.

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

Khandaker Ikrama khikrama

🏠
Working from home
View GitHub Profile
// Sticky Header
$(window).scroll(function() {
if ($(window).scrollTop() > 100) {
$('.main_h').addClass('sticky');
} else {
$('.main_h').removeClass('sticky');
}
});
add_action( 'wp_enqueue_scripts', 'jk_masonry' );
function jk_masonry() {
wp_enqueue_script( 'jquery-masonry', array( 'jquery' ) );
}
/*
How to use?
$('#container').masonry({ singleMode: true });
function wpsites_modify_comment_form_fields($fields){
$fields['author'] = '<p class="comment-form-author">' . '<label for="author">' . __( 'Author', 'wpsites.net' ) . '</label> ' .
( $req ? '<span class="required">*</span>' : '' ) .
'<input id="author" name="author" type="text" placeholder="Real name, please, no keyword spamming!" value="' .
esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>';
function add_new_comment_form_field($fields) {
$fields['phone'] = '<p class="comment-form-phone"><label for="phone">' . __( 'Phone', 'wpsites.net' ) . '</label>' .
'<input id="url" name="url" type="text" placeholder="E.T Phone Home Please" value="' .
esc_attr( $commenter['comment_author_phone'] ) . '" size="30" /></p>';
return $fields;
}
function wpsites_customize_comment_form_text_area($arg) {
$arg['comment_field'] = '<p class="comment-form-comment"><label for="comment">' . _x( 'Your Feedback Is Appreciated', 'noun' ) . '</label><textarea id="comment" name="comment" placeholder="Please Use Pastebin or Github Gists If You Want To Leave PHP Code In Your Comment. Thanks!"cols="45" rows="1" aria-required="true"></textarea></p>';
return $arg;
}
add_filter('comment_form_defaults', 'wpsites_customize_comment_form_text_area');
function wpsites_modify_comment_form_text_area($arg) {
$arg['comment_field'] = '<p class="comment-form-comment"><label for="comment">' . _x( 'Your Feedback Is Appreciated', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="1" aria-required="true"></textarea></p>';
return $arg;
}
add_filter('comment_form_defaults', 'wpsites_modify_comment_form_text_area');
<?php
// Modify the default WooCommerce orderby dropdown
//
// Options: menu_order, popularity, rating, date, price, price-desc
// In this example I'm removing price & price-desc but you can remove any of the options
function my_woocommerce_catalog_orderby( $orderby ) {
unset($orderby["price"]);
unset($orderby["price-desc"]);
return $orderby;
}
/**
* Add "Ingredients" and "Benefits" tabs to WooCommerce products
*
* @link http://blackhillswebworks.com/?p=5453
* @link http://www.sean-barton.co.uk/2013/03/remove-woocommerce-20-reviews-tab
* @link http://www.php.net/manual/en/function.htmlspecialchars-decode.php
*/
add_filter( 'woocommerce_product_tabs', 'bhww_woo_extra_tabs' );
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2015.09.14
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */
@khikrama
khikrama / mixins.less
Created January 30, 2017 09:49
Useful CSS3 LESS Mixins
.text-shadow (@string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
text-shadow: @string;
}
.box-shadow (@string) {
-webkit-box-shadow: @string;
-moz-box-shadow: @string;
box-shadow: @string;
}
.drop-shadow (@x: 0, @y: 1px, @blur: 2px, @spread: 0, @alpha: 0.25) {
-webkit-box-shadow: @x @y @blur @spread rgba(0, 0, 0, @alpha);