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: content-single.php
Change the line 14:
<h1 class="entry-title"><?php the_title(); ?><span></span></h1>
Make it look like:
<h2 class="entry-title"><?php the_title(); ?><span></span></h2>
@thanh4890
thanh4890 / functions.php
Last active August 29, 2015 13:57
Remove specific theme from WordPress Core Updates.
<?php
// remove specific theme from WordPress Core Updates
add_filter('site_transient_update_themes', 'ndt_remove_theme_from_transient_update_themes');
function ndt_remove_theme_from_transient_update_themes( $transient ) {
if ( is_object( $transient ) && isset( $transient->checked ) && isset( $transient->response ) ) {
$checked = $transient->checked;
$response = $transient->response;
@thanh4890
thanh4890 / anti-spam-comment-field.php
Created March 19, 2014 08:48
Add an extra anti spam comment form field in WordPress comment
<?php
/**
* Extra anti spam comment form field
*
* @package ndt_framework
*/
/**
* Add anti spam comment form field
* @param array $fields The default comment fields.
For example: to change icon of service intro widget, inside widget method of Kopa_Widget_Services_Intro class, find the line:
echo $before_title . '<span data-icon="&#xe278;"></span>' . $title . $after_title;
Change icon to home:
echo $before_title . '<span data-icon="&#xe010;"></span>' . $title . $after_title;
a:2:{s:6:"params";a:70:{s:5:"title";s:10:"Revolution";s:5:"alias";s:10:"Revolution";s:9:"shortcode";s:23:"[rev_slider Revolution]";s:11:"slider_type";s:9:"fullwidth";s:27:"fullscreen_offset_container";s:0:"";s:5:"width";s:4:"1086";s:6:"height";s:3:"435";s:15:"responsitive_w1";s:3:"940";s:16:"responsitive_sw1";s:3:"770";s:15:"responsitive_w2";s:3:"780";s:16:"responsitive_sw2";s:3:"500";s:15:"responsitive_w3";s:3:"510";s:16:"responsitive_sw3";s:3:"310";s:15:"responsitive_w4";s:0:"";s:16:"responsitive_sw4";s:0:"";s:15:"responsitive_w5";s:0:"";s:16:"responsitive_sw5";s:0:"";s:15:"responsitive_w6";s:0:"";s:16:"responsitive_sw6";s:0:"";s:5:"delay";s:4:"9000";s:7:"shuffle";s:3:"off";s:9:"lazy_load";s:3:"off";s:15:"load_googlefont";s:5:"false";s:11:"google_font";s:22:"PT+Sans+Narrow:400,700";s:11:"stop_slider";s:3:"off";s:16:"stop_after_loops";s:1:"0";s:13:"stop_at_slide";s:1:"2";s:8:"position";s:6:"center";s:10:"margin_top";s:1:"0";s:13:"margin_bottom";s:1:"0";s:11:"margin_left";s:1:"0";s:12:"margin_right";s:1:"0";s
<?php
define('KOPA_THEME_NAME', 'Nictitate');
define('KOPA_DOMAIN', 'nictitate');
define('KOPA_CPANEL_IMAGE_DIR', get_template_directory_uri() . '/library/images/layout/');
define('KOPA_UPDATE_TIMEOUT', 21600);
define('KOPA_UPDATE_URL', 'http://kopatheme.com/notifier/nictitate.xml');
require (get_template_directory()) . '/library/kopa.php';
require (get_template_directory()) . '/library/ini.php';
@thanh4890
thanh4890 / breadcrumb
Created March 26, 2014 03:15
Support: Eliana
/**
* Template tag: print breadcrumb
*/
function kopa_breadcrumb() {
// get show/hide option
$kopa_breadcrumb_status = get_option('kopa_theme_options_breadcrumb_status', 'show');
if ( $kopa_breadcrumb_status != 'show' ) {
return;
}
In your theme directory, open this file: header.php
Replace line 114
<div id="header-bottom" class="<?php if ( 'enable' === get_option('kopa_theme_options_sticky_menu_status', 'enable') ) { echo 'cbp-af-header'; } ?>">
By the line:
<div id="header-bottom" class="<?php if ( 'enable' === get_option('kopa_theme_options_sticky_menu_status', 'enable') || ! is_front_page() ) { echo 'cbp-af-header'; } ?>">
/**
* Display testimonials widget
* @since Nictitate 1.0
*/
class Kopa_Widget_Staffs extends WP_Widget {
function __construct() {
$widget_ops = array('classname' => 'kopa-our-team-widget', 'description' => __('Display a staffs widget', kopa_get_domain()));
$control_ops = array('width' => 'auto', 'height' => 'auto');
parent::__construct('kopa_widget_staffs', __('Kopa Staffs Widget', kopa_get_domain()), $widget_ops, $control_ops);
In your theme directory, open this file: library/includes/widgets.php
Find the blog in widget method of Kopa_Widget_Services_Intro class:
<h2 class="entry-title clearfix"><span class="<?php echo $icon_class; ?>"></span><a href="<?php echo $service_url; ?>"><?php the_title(); ?></a></h2>
Replace it by:
<h2 class="entry-title clearfix"><span class="<?php echo $icon_class; ?>"></span><?php the_title(); ?></h2>