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_action( 'genesis_before_comments' , 'nabm_post_check' ); | |
function nabm_post_check () { | |
if ( is_single() ) { | |
if ( have_comments() ) { | |
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' ); | |
add_action( 'genesis_list_comments', 'genesis_do_comment_form' , 5 ); | |
} | |
} | |
} |
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
//* Get post view counts | |
function getPostViews($postID){ | |
$count_key = 'post_views_count'; | |
$count = get_post_meta($postID, $count_key, true); | |
if($count==''){ | |
delete_post_meta($postID, $count_key); | |
add_post_meta($postID, $count_key, '0'); | |
return "0 Views"; | |
} | |
return $count.' Views'; |
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_action( 'genesis_before_loop', 'sk_excerpts_search_page' ); | |
function sk_excerpts_search_page() { | |
if ( is_search() ) { | |
add_filter( 'genesis_pre_get_option_content_archive', 'sk_show_excerpts' ); | |
} | |
} | |
function sk_show_excerpts() { | |
return 'excerpts'; | |
} |
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
//* Redirect posts to original URL | |
add_action( 'template_redirect', 'nabm_original_post_redirect' ); | |
function nabm_original_post_redirect() { | |
if ( ! is_singular() ) { | |
return; | |
} | |
if ( $url = genesis_get_custom_field( 'rss_pi_source_url' ) ) { | |
wp_redirect( esc_url_raw( $url ), 301 ); | |
exit; | |
} |
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 the page widget in the content - XHTML | |
add_action( 'genesis_after_post_content', 'nabm_add_page_content' ); | |
function nabm_add_page_content() { | |
if ( is_page('ID') ) | |
genesis_widget_area ('page-widget', array( | |
'before' => '<div class="page-widget"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} |
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
genesis_register_sidebar( array( | |
'id' => 'page-widget', | |
'name' => __( 'Page Widget', 'nabm' ), | |
'description' => __( 'This is the widget area for a specific page.', 'nabm' ), | |
) ); |
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 the page widget in the content - HTML5 | |
add_action( 'genesis_entry_footer', 'nabm_add_page_content' ); | |
function nabm_add_page_content() { | |
if ( is_page('ID') ) | |
genesis_widget_area ('page-widget', array( | |
'before' => '<div class="page-widget"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} |
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
/* Page Widget | |
------------------------------------------------------------ */ | |
.page-widget { | |
line-height: 1.5; | |
padding: 30px; | |
} | |
.page-widget p { | |
margin-bottom: 24px; |
NewerOlder