Skip to content

Instantly share code, notes, and snippets.

View alexkalh's full-sized avatar

I'm tranthethang alexkalh

View GitHub Profile
@alexkalh
alexkalh / 2016.09.22 - html_enliven 2.0 - resize top banner
Created September 22, 2016 14:43
2016.09.22 - html_enliven 2.0 - resize top banner
/*
The width of top-banner is not fixed!
The Enliven is using bootstrap grid. You can change width of column by class:
e.g.
Logo's column: "e_left", please change "col-md-6" to "col-md-3"
Banner's column: "e_right", please change "col-md-6" to "col-md-9"
*/
@alexkalh
alexkalh / 2016.09.19 - enliven 1.8.1 - inc - skin - schema.php
Created September 18, 2016 17:19
2016.09.19 - enliven 1.8.1 - inc - skin - schema.php
<?php
if( !function_exists( 'enliven_get_color_scheme_string' ) ){
function enliven_get_color_scheme_string(){
$css = '
a {
color: %3$s;
}
a:hover, a:focus {
@alexkalh
alexkalh / 2016.09.16 - enliven 1.7.1 - inc - functions.php
Created September 16, 2016 16:09
2016.09.16 - enliven 1.7.1 - inc - functions.php
<?php
// File ../inc/functions.php
// Line 153 to 159
if( ! empty( $value['font_size'] ) ){
$tmp .= sprintf( ' font-size: %spx; ', $value['font_size'] );
}
if( ! empty( $value['line_height'] ) ){
$tmp .= sprintf( ' line-height: %spx; ', $value['line_height'] );
}
@alexkalh
alexkalh / 2016.09.16 - enliven 1.7 - inc - functions.php
Created September 16, 2016 16:07
Enliven 1.7 - typography's issue
<?php
// File ../inc/functions.php
// Line 153 to 159
if( ! empty( $value['font_size'] ) ){
$tmp .= sprintf( ' font-size: %s; ', $value['font_size'] );
}
if( ! empty( $value['line_height'] ) ){
$tmp .= sprintf( ' line-height: %s; ', $value['line_height'] );
/*
* Remove warning : Invalid argument supplied for foreach() on functions.php on line 451
* @version 1.2
*
* Open file: wp-content/themes/enliven/inc/functions.php
*
* Select codes from 444 to 458
* Replace it by new codes below:
*
*/
@alexkalh
alexkalh / add-first-and-last-css-classes-for-sidebar-widgets-wordpress
Created March 17, 2015 10:16
Add first and last css classes for sidebar widgets wordpress
<?php
add_action('init', 'ak_add_order_classes_for_widgets' );
function ak_add_order_classes_for_widgets() {
global $wp_registered_sidebars, $wp_registered_widgets;
#Grab the widgets
$sidebars = wp_get_sidebars_widgets();
if ( empty( $sidebars ) ) {
@alexkalh
alexkalh / php-convert-color-code-from-hex-to-rgba
Created January 7, 2015 03:23
php-convert-color-code-from-hex-to-rgba
<?php
function ak_convert_hex2rgba($color, $opacity = false) {
$default = 'rgb(0,0,0)';
if (empty($color))
return $default;
if ($color[0] == '#')
$color = substr($color, 1);
@alexkalh
alexkalh / auto-set-featured-image-for-post-by-random
Last active August 29, 2015 14:12
Auto set featured image for post by random
<?php
$begin_ID = 1;
$end_ID = 10;
$items = array();
for ($i = $begin_ID; $i <= $end_ID; $i++) {
$items[] = $i;
}