Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Thanh Nguyen Dac thanh4890

🏠
Working from home
View GitHub Profile
@thanh4890
thanh4890 / Paragraph inline font-family style
Created Feb 6, 2014
Paragraph inline font-family style
View 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 Feb 11, 2014
Fast News, customize entry list 2 widget title
View fastnews-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 Aug 29, 2015
https fonts
View https-font
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');
----
View css3-mediaqueries.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;
View remove-link-symbols-over-the-image
View kopa_widget_socials.php
/**
* @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);
}
View post-navigation.php
<?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() );
View ultra-mag
1) Open this file: library/templates/format-single.php
Replace the line 21:
<div class="entry-thumb"><?php the_post_thumbnail( 'kopa-single-featured-size' ); ?></div>
By the line:
<div class="entry-thumb"><?php the_post_thumbnail( 'large' ); ?></div>
You can do the same for other post format template files:
library/templates/format-single-video.php
library/templates/format-single-audio.php
View Kopa_Widget_Posts_List.php
class Kopa_Widget_Posts_List extends WP_Widget {
function __construct() {
$widget_ops = array('classname' => 'kopa-latest-post-widget', 'description' => __('Display a posts list widget', kopa_get_domain()));
$control_ops = array('width' => 'auto', 'height' => 'auto');
parent::__construct('kopa_widget_posts_list', __('Kopa Posts List', kopa_get_domain()), $widget_ops, $control_ops);
}
function widget($args, $instance) {
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
@thanh4890
thanh4890 / post-navigation.php
Created Mar 7, 2014
Nictitate support: date in post navigation cannot be translated
View post-navigation.php
<?php
$prev_post = get_previous_post();
if ( ! empty( $prev_post ) ) :
?>
<p class="prev-post">
<a href="<?php echo get_permalink( $prev_post->ID ); ?>">&laquo;&nbsp;<?php _e('Previous Article', kopa_get_domain()); ?></a>
<a class="article-title" href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php echo $prev_post->post_title; ?></a>
<span class="entry-date"><?php echo get_post_time( get_option( 'date_format' ), false, $prev_post->ID, true ); ?></span>
</p>
<?php endif; ?>