Skip to content

Instantly share code, notes, and snippets.

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

Thanh Nguyen Dac thanh4890

🏠
Working from home
View GitHub Profile
In your theme directory, open this file: library/includes/widgets.php
Find the block, it's located in widget method of Kopa_Widget_Socials class
<?php if ( ! empty( $vimeo ) ) : ?>
<li><a href="<?php echo esc_url( $vimeo ); ?>" data-icon="&#xe174;"></a></li>
<?php endif; ?>
/**
* cbpAnimatedHeader.min.js v1.0.0
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2013, Codrops
* http://www.codrops.com
*/
<?php
$kopa_setting = kopa_get_template_setting();
$sidebars = $kopa_setting['sidebars'];
get_header(); ?>
<div id="main-content">
<div class="widget">
<?php if ( is_active_sidebar( $sidebars[0] ) )
dynamic_sidebar( $sidebars[0] );
<?php
add_action( 'wp_enqueue_scripts', 'kopa_nictitate_child_theme_customize_extra_style' );
function kopa_nictitate_child_theme_customize_extra_style() {
wp_enqueue_style('kopa-child-theme-extra-style', get_stylesheet_directory_uri() . '/css/extra.css', array('kopa-extra-style'), null );
}
<?php $kopa_setting = kopa_get_template_setting();
$layout_id = $kopa_setting['layout_id'];
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( has_post_thumbnail() && get_post_format() == '' ) :
$thumbnail_id = get_post_thumbnail_id();
$thumbnail = wp_get_attachment_image_src( $thumbnail_id, 'kopa-image-size-0' );
?>
<div class="entry-thumb">
<img src="<?php echo $thumbnail[0]; ?>" alt="<?php the_title(); ?>">
@thanh4890
thanh4890 / medium-size
Created April 29, 2015 06:16
Crop thumbnail to exact dimensions on Wordpress for medium size
if(false === get_option("medium_crop")) {
add_option("medium_crop", "1");
} else {
update_option("medium_crop", "1");
}
PHP Framework
laravel
zend
yii
code igniter
Caching
memcached
redis
@thanh4890
thanh4890 / .htaccess
Last active September 23, 2015 03:57
CodeIgniter remove index.php
v1 in root:
RewriteEngine on
RewriteBase /ci
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
v2 in public/:
<IfModule mod_rewrite.c>
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 ) {
// Options toggler hanlder
// To turn on/off other options base on toggler selection
function initOptionToggler() {
$(document).delegate('.yk-toggler', 'click', function(){
var toggler_name = $(this).attr("name").replace("option_tree[","").replace("]","");
var toggler_value = $(".yk-toggler[name*="+toggler_name+"]:checked").val();
// Turn off all .yk-toggle-able fields
$(".yk-toggle-able[class*="+toggler_name+"]").parents(".format-settings").slideUp();