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
<?php | |
//* DO NOT include the opening PHP tag | |
//* Automatically link Twitter names to Twitter URL | |
function twtreplace($content) { | |
$twtreplace = preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/',"$1<a href=\"http://twitter.com/$2\" target=\"_blank\" rel=\"nofollow\">@$2</a>",$content); | |
return $twtreplace; | |
} |
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
// Change default comment text | |
function nabm_change_comment_text($args) { | |
$args['title_reply'] = 'Leave a Comment'; | |
return $args; | |
} | |
add_filter( 'genesis_comment_form_args', 'nabm_change_comment_text' ); |
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
// Remove the edit link | |
add_filter ( 'genesis_edit_post_link' , '__return_false' ); |
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
//* Enable shortcodes in widgets | |
add_filter('widget_text', 'do_shortcode'); |
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
// Enable PHP in widgets | |
add_filter('widget_text','execute_php',100); | |
function execute_php($html){ | |
if(strpos($html,"<"."?php")!==false){ | |
ob_start(); | |
eval("?".">".$html); | |
$html=ob_get_contents(); | |
ob_end_clean(); | |
} | |
return $html; |
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 Read More text | |
add_filter( 'excerpt_more', 'nabm_more_link' ); | |
add_filter( 'get_the_content_more_link', 'nabm_more_link' ); | |
add_filter( 'the_content_more_link', 'nabm_more_link' ); | |
function nabm_more_link() { | |
return '<a href="' . get_permalink() . '" rel="nofollow"><strong>Continue Reading...</strong></a>'; | |
} |
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 welcome message before content on homepage | |
add_action( 'genesis_before_loop', 'nabm_welcome_message' ); | |
function nabm_welcome_message() { | |
if ( ! is_home() || get_query_var( 'paged' ) >= 2 ) | |
return; | |
genesis_widget_area( 'welcome-message', array( | |
'before' => '<div class="welcome-message" class="widget-area">', | |
'after' => '</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
// Add the newsletter widget after the post content | |
add_action( 'genesis_after_post_content', 'nabm_add_newsletter_box' ); | |
function nabm_add_newsletter_box() { | |
if ( is_singular( 'post' ) ) | |
genesis_widget_area( 'newsletter', array( | |
'before' => '<div id="newsletter">', | |
) ); | |
} | |
genesis_register_sidebar( array( |
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 custom dashboard widget | |
add_action('wp_dashboard_setup', 'nabm_dashboard_widget'); | |
function nabm_dashboard_widget() { | |
global $wp_meta_boxes; | |
wp_add_dashboard_widget('custom_help_widget', 'ADD WIDGET TITLE HERE', 'custom_dashboard_help'); | |
} | |
function custom_dashboard_help() { | |
echo '<p>PLACE YOUR WIDGET CONTENT HERE, INCLUDING HTML.</p>'; | |
} |