This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Customize the Post Info Conditionally on Home Page and Single Post in Genesis Sample Theme | |
add_filter( 'genesis_post_info', 'post_info_filter' ); | |
function post_info_filter( $post_info ) { | |
if ( is_front_page() || is_archive() ) : | |
$post_info = '[post_date] [post_comments zero="0 Comments" one="1 Comment" more="% Comments"]'; | |
return $post_info; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code to Display Featured Image on top of the post | |
add_action( 'genesis_entry_content', 'featured_post_image', 5 ); | |
function featured_post_image() { | |
if ( !is_singular( array( 'post', 'page' ) )) return; | |
the_post_thumbnail('post-image'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Removes Title and Description on Blog Archive and Category Archive | |
remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' ); | |
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Customize Entry Meta Filed Under and Tagged Under | |
add_filter( 'genesis_post_meta', 'sleek_pro_meta_footer' ); | |
function sleek_pro_meta_footer( $post_meta ) { | |
$post_meta = '[post_categories before=""] [post_tags before=""]'; | |
return $post_meta; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Apply Relative Date Lengths in Genesis | |
// (credit: http://www.billerickson.net/genesis-relative-date-length/) | |
add_filter( 'genesis_post_info', 'sp_post_info_filter' ); | |
function sp_post_info_filter($post_info) { | |
if ( !is_page() ) { | |
$post_info = '<i class="fa fa-clock-o"></i> [post_date format="relative" relative_depth="1"] <i class="fa fa-eye"></i> [postview] [post_comments zero="0 Comments" one="1 Comment" more="% Comments"]'; | |
return $post_info; | |
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Post Views on Genesis Framework | Credit: http://www.joemaraparecio.com/how-to-add-post-views-in-genesis/ | |
// Set Post Views :It counts everytime single posts is viewed | |
if ( !function_exists( 'ja_setPostViews' ) ){ | |
function ja_setPostViews( $postID ){ | |
$count_key = 'ja_post_views'; | |
$count = get_post_meta($postID, $count_key, true); | |
if( $count == '' ){ | |
$count = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Display Post Word Count in Genesis | |
// Note: Special Thanks to Victor Front: Ref: https://www.facebook.com/groups/genesiswp/permalink/1536463436404848/ | |
// And Sridhar: https://sridharkatakam.com/display-word-count-posts-genesis/ | |
// Print Post Word Count and Create a Shortcode | |
add_shortcode( 'word-count', 'post_word_count' ); | |
function post_word_count() { | |
return sprintf( __( '%s Words', 'leaguewp' ), str_word_count( strip_tags( get_post_field( 'post_content', get_the_ID() ) ), 0 ) ); | |
} |
OlderNewer