Skip to content

Instantly share code, notes, and snippets.

Vũ Đức Mạnh manhleo93

Block or report user

Report or block manhleo93

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View functions.php
// Apply Full Width Content layout to Posts page, Single Posts and Archives.
add_action( 'get_header', 'sk_set_full_layout' );
function sk_set_full_layout() {
if ( ! ( is_home() || is_singular( 'post' ) || is_archive() ) ) {
return;
}
// Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
}
View code.txt
<pre>
Nơi chèn nội dung code html, php, css, txt..
</pre>
@manhleo93
manhleo93 / test.txt
Last active Aug 22, 2017
Hướng dẫn chèn code từ github về bài viết wordpress.
View test.txt
Chào các bạn mình là mạnh leo đây
mình sẽ hướng dẫn các bạn chèn code từ GitHub về bài viết của bạn.
Bằng cách dán mã code vào đây?
View functions.php
add_action( 'get_header', 'sk_set_404_layout' );
/**
* Force full width content on 404 pages
*
* @author Sridhar Katakam
*/
function sk_set_404_layout() {
if ( ! is_404() ) {
return;
}
View gist:f50fd3bd50c1d1ff9042a8174c0e4377
// Change 'genesis_html5_comment_callback' to 'gtcn_basic_callback' provided by Greg's Threaded Comment Numbering plugin for numbering commnets
add_filter( 'genesis_comment_list_args', 'sk_add_numbered_comments' );
function sk_add_numbered_comments( $defaults ) {
if ( function_exists( 'gtcn_basic_callback' ) ) {
$defaults['callback'] = genesis_html5() ? 'gtcn_basic_callback' : 'genesis_comment_callback';
}
return $defaults;
View gist:98b03aeb09cb09b2fee7fd3396fef1d6
.commentnumber {
float: right;
font-size: 12px;
background: #ddd;
padding: 5px 10px;
}
View gist:a220aef1d4bb854b2634a0d21b5cb049
add_filter( 'manage_media_columns', 'sk_media_columns_url' );
/**
* Filter the Media list table columns to add a URL column.
*
* @param array $posts_columns Existing array of columns displayed in the Media list table.
* @return array Amended array of columns to be displayed in the Media list table.
*/
function sk_media_columns_url( $posts_columns ) {
$posts_columns['media_url'] = 'URL';
return $posts_columns;
View functions.php
// Register Horizontal Opt-in widget area
genesis_register_widget_area(
array(
'id' => 'horizontal-opt-in',
'name' => __( 'Horizontal Opt-in', 'my-theme-text-domain' ),
'description' => __( 'This is the horizontal opt-in section.', 'my-theme-text-domain' ),
)
);
// Display Horizontal Opt-in widget area below header
View gist:5815c533f1a2dca0c99d8cab7a5d4a4a
jQuery(function($){
// $('.post-listing').append( '<button class="load-more">Load More</button>' );
// var button = $('.post-listing .load-more');
var page = 2;
var loading = false;
$('body').on('click', '.load-more', function(){
if( ! loading ) {
loading = true;
You can’t perform that action at this time.