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
@thanh4890
thanh4890 / forceful-gallery-new-link
Created January 9, 2014 02:40
Forceful gallery new link
@thanh4890
thanh4890 / forceful link caption
Created January 9, 2014 02:42
Forceful link caption
<div class="widget kopa-gallery-widget">
<h4 class="widget-title">Gallery <span>Recent Images</span></h4>
<div class="list-carousel responsive" >
<ul class="kopa-gallery-carousel">
<li style="width: 140px;">
<a rel="prettyPhoto[kp-gallery]" href="placeholders/post-image/p-8.jpg"><img src="placeholders/post-image/p-8.jpg" alt="" /></a>
</li>
<li style="width: 140px;">
<a rel="prettyPhoto[kp-gallery]" href="placeholders/post-image/p-9.jpg"><img src="placeholders/post-image/p-9.jpg" alt="" /></a>
</li>
@thanh4890
thanh4890 / Paragraph inline font-family style
Created February 6, 2014 03:01
Paragraph inline font-family style
<p style="font-family: Georgia, serif;">Georgia Serif font</p>
<p style="font-family: verdana, sans-serif;">Verdana font</p>
@thanh4890
thanh4890 / fastnews-entry-list-2-widget-title
Created February 11, 2014 02:56
Fast News, customize entry list 2 widget title
if ( ! empty( $instance['categories'] ) && isset( $instance['categories'][0] ) ) {
$first_cat_id = $instance['categories'][0];
echo $before_title . '<a href="' . get_category_link( $first_cat_id ) . '">' . get_cat_name( $first_cat_id ) . '</a>' . $after_title;
} elseif ( ! empty( $title ) ) {
echo $before_title . $title . $after_title;
}
@thanh4890
thanh4890 / https-font
Last active August 29, 2015 13:56
https fonts
Open this file: library/front.php
Line 175
Change:
wp_enqueue_script('kopa-google-api', 'http://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
To:
wp_enqueue_script('kopa-google-api', 'https://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');
----
if(typeof Object.create!=="function"){
Object.create=function(o){
function F(){
};
F.prototype=o;
return new F();
};
}
var ua={toString:function(){
return navigator.userAgent;
/**
* @since Nictitate 1.0
*/
class Kopa_Widget_Socials extends WP_Widget {
function __construct() {
$widget_ops = array('classname' => 'kopa-social-widget', 'description' => __('Socials Widget', kopa_get_domain()));
$control_ops = array('width' => 'auto', 'height' => 'auto');
parent::__construct('kopa_widget_socials', __('Kopa Socials', kopa_get_domain()), $widget_ops, $control_ops);
}
<?php
$previous_title = __( 'Previous Article', kopa_get_domain() );
$next_title = __( 'Next Article', kopa_get_domain() );
if ( 'staffs' === get_post_type() ) {
$previous_title = __( 'Previous Staff', kopa_get_domain() );
$next_title = __( 'Next Staff', kopa_get_domain() );
} elseif ( 'clients' === get_post_type() ) {
$previous_title = __( 'Previous Client', kopa_get_domain() );
$next_title = __( 'Next Client', kopa_get_domain() );