Skip to content

Instantly share code, notes, and snippets.

View hemusyl's full-sized avatar

Humayun Kabir hemusyl

View GitHub Profile
@hemusyl
hemusyl / TinyMCE by Hk
Created October 30, 2015 07:47
TinyMCE by Hk
http://www.wpexplorer.com/wordpress-tinymce-tweaks/
//tinymce-domain.php
<?php
// Hooks your functions into the correct filters
function desparate_add_mce_button() {
// check user permissions
if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
return;
}
// check if WYSIWYG is enabled
@hemusyl
hemusyl / Bootstrap Dropdown with Hover
Created October 22, 2015 19:42
Bootstrap Dropdown with Hover
Bootstrap Dropdown with Hover
.dropdown:hover .dropdown-menu {
display: block;
margin-top: 0; // remove the gap so it doesn't close
}
==================================================================
OR
.sidebar-nav {
@hemusyl
hemusyl / gist:a32c9d848c506e0ecf85
Created October 9, 2015 13:59 — forked from wcodex/gist:8825693
Custom WordPress search form using bootstrap 3.0
?>
<form class="navbar-form" role="search" action="<?php echo site_url('/'); ?>" method="get" >
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="s" id="search" value="<?php the_search_query(); ?>">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
@hemusyl
hemusyl / How to Show Your MailChimp Subscriber Count in WordPress
Created October 9, 2015 13:56
How to Show Your MailChimp Subscriber Count in WordPress
http://www.wpbeginner.com/wp-tutorials/how-to-show-your-mailchimp-subscriber-count-in-wordpress/
<?php
/*
Plugin Name: MailChimp Subscriber Count
Plugin URI: http://www.wpbeginner.com
Description: Retrieves MailChimp subscriber count and displays it as a text
Version: 1.0
Author: WPBeginner
Author URI: http://www.wpbeginner.com
jQuery(document).ready(function () {
$(".current-menu-item").addClass("active");
});
OR
jQuery(document).ready(function () {
jQuery(".current-menu-item").addClass("active");
});
OR
jQuery(document).ready(function ($) {
http://docs.woothemes.com/documentation/plugins/woocommerce/ All documentation is here
<?php
http://docs.woothemes.com/document/editing-product-data-tabs/
===================================================================================
http://code.tutsplus.com/articles/an-introduction-to-theming-woocommerce-for-wordpress--wp-31577
Disabling the Default Stylesheet and Starting From Scratch
//code to your themes functions.php
define('WOOCOMMERCE_USE_CSS', false);
<?php
----------------------------------------------------------
For style css
/*
Theme Name: Payra TV
Theme URI: http://www.payratv.com
Author: Humayun Kabir
Author URI: http://www.hkfolio.com/
Description: This theme created for payratv.
@hemusyl
hemusyl / gist:b46781831d6d7d05687a
Last active August 29, 2015 14:26 — forked from mikejolley/gist:1565309
WooCommerce - Filters to add custom currencies and symbols
add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['ABC'] = __( 'Currency name', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {
@hemusyl
hemusyl / gist:eef1bd5bc018c5e9f2e0
Last active August 29, 2015 14:26 — forked from corsonr/gist:9152652
WooCommerce : add custom fields to product variations
<?php
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 );
/**
// front end
function custom_front_scripts() {
wp_enqueue_style( 'front-css', plugins_url('/lib/css/front-css.css', __FILE__), array(), null, 'all' );
wp_enqueue_script( 'front-init', plugins_url('/lib/js/front.init.js', __FILE__) , array('jquery'), null, true );
}
add_action('wp_enqueue_scripts', 'custom_front_scripts' );
// back end
function custom_admin_scripts() {