Skip to content

Instantly share code, notes, and snippets.

View nhatdongnguyen's full-sized avatar

Nguyen Nhat Dong nhatdongnguyen

View GitHub Profile
<?php
/** Do not include <?php on editing */
$creds = 'Copyright [footer_copyright] <a href="'.get_bloginfo( 'url' ).'">'.get_bloginfo( 'name' ).'</a></p><p>Developed by <a href="#">XYZ</a>';
<?php
/** Do not include <?php on editing */
$creds = 'Copyright [footer_copyright] <a href="'.get_bloginfo( 'url' ).'">'.get_bloginfo( 'name' ).'</a><p>Developed by <a href="#">XYZ</a></p>';
<?php
/** Do not include <?php on editing */
// Change the footer text
add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_filter' );
function sp_footer_creds_filter( $creds ) {
$creds = 'Copyright [footer_copyright] <a href="'.get_bloginfo( 'url' ).'">'.get_bloginfo( 'name' ).'</a>';
return $creds;
}
@nhatdongnguyen
nhatdongnguyen / woo-related-products-output.php
Created November 4, 2015 10:13
Change number of related products output
@nhatdongnguyen
nhatdongnguyen / gist:99fa9de17fc801be54ed
Last active August 29, 2015 14:20
Display views count after entry title on single entry
<?php
//* Display views count after entry title on single entry
add_action( 'genesis_entry_header', 'post_views_count' );
function post_views_count() {
if ( ! is_singular( 'post' ) )
return;
echo post_views(get_the_ID());
<?php
// Register a custom image size for Singular Featured images
add_image_size( 'singular-featured-thumb', 800, 250, true );
add_action( 'genesis_before_entry', 'sk_display_featured_image' );
function sk_display_featured_image() {
if ( ! is_singular( array( 'post', 'page' ) ) ) {
return;
}
<?php
add_action('wp_enqueue_scripts', 'sp_style_sheet');
function sp_style_sheet() {
wp_enqueue_style( 'custom-style', get_stylesheet_directory_uri() . '/custom.css' );
}
<?php
add_filter( 'the_content', 'sp_adsense_first_paragraph' );
function sp_adsense_first_paragraph ( $content ) {
if ( !is_single() )
return $content;
$paragraphAfter = 2; //Enter paragraph number
$content = explode ( "</p>", $content );
$new_content = '';
<?php
//* Do NOT include the opening php tag
// Add support for 4-column footer widgets
add_theme_support( 'genesis-footer-widgets', 4 );