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
/* Use CSS to customize WordPress widget titles */ | |
.widget-area .widget_recent_entries h4 { | |
background: url("images/image-name.png") no-repeat scroll left 6px transparent; | |
padding-left: 40px; | |
} | |
.widget-area h4 { | |
border-bottom: 4px double #ccc; | |
border-top: 4px double #ccc; | |
font-size: 24px; |
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 this comment or the opening php tag above | |
//* Insert SPAN tag into widgettitle | |
add_filter( 'dynamic_sidebar_params', 'b3m_wrap_widget_titles', 20 ); | |
function b3m_wrap_widget_titles( array $params ) { | |
// $params will ordinarily be an array of 2 elements, we're only interested in the first element | |
$widget =& $params[0]; | |
$widget['before_title'] = '<h4 class="widgettitle"><span class="sidebar-title">'; | |
$widget['after_title'] = '</span></h4>'; |
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 this comment or the opening php tag above | |
//* Wrap first word of widget title into a span tag | |
add_filter ( 'widget_title', 'b3m_add_span_widgets' ); | |
function b3m_add_span_widgets( $old_title ) { | |
$title = explode( " ", $old_title, 2 ); | |
if ( isset( $title[0] ) && isset( $title[1] ) ) { |
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 | |
// Step 2: Place code below into your theme's functions.php file | |
if ( include( 'custom_widgets.php' ) ){ | |
add_action( "widgets_init", "load_custom_widgets" ); | |
} | |
function load_custom_widgets() { | |
unregister_widget( "WP_Widget_Text" ); | |
register_widget( "WP_Widget_Text_Custom" ); |
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 | |
/** | |
* Recent_Posts widget class | |
* | |
* @since 2.8.0 | |
*/ | |
class WP_Widget_Recent_Posts_Custom extends WP_Widget_Recent_Posts { | |
function __construct() { |
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
<!-- STEP 2 --> | |
<!-- The code below is placed into a file named adsense-archive.php as noted in the Gist above. --> | |
<div id="archive-adsense-wrapper"> | |
<div class="ad-left"> | |
<script type="text/javascript"><!-- | |
google_ad_client = "ca-pub-xxxxxxxxxxxxx"; | |
google_ad_slot = "xxxxxxxxx"; | |
google_ad_width = 250; | |
google_ad_height = 250; |
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 | |
//* Add Organization schema to our logo | |
//* Note that logo location is not inside WordPress. It's in a folder named 'img' off of the root of website. | |
add_filter( 'genesis_seo_title', 'b3m_header_title', 10, 3 ); | |
function b3m_header_title( $title, $inside, $wrap ) { | |
$inside = sprintf( '<div itemscope="itemscope" itemtype="http://schema.org/Organization"><a itemprop="url" href="%s" title="%s"><img class="logo" itemprop="logo" src="http://www.YOUR-DOMAIN.com/img/YOUR-LOGO.png" alt="%s" /></a></div>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) ); | |
return sprintf( '<%1$s id="title">%2$s</%1$s>', 'span', $inside ); | |
} |
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 | |
/** | |
* Custom Post-Info with Google Rich Snippet support | |
* @link: https://gist.github.com/rickrduncan/6494748 | |
* @author: Rick R. Duncan - www.rvamedia.com | |
* @credits: Greg Rickaby & Brad Dalton | |
*/ | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); |