Skip to content

Instantly share code, notes, and snippets.

View grtaylor2's full-sized avatar

Greg Taylor grtaylor2

View GitHub Profile
@grtaylor2
grtaylor2 / gist:4332961
Created December 18, 2012 23:08
Specific WordPress header by category. This will work for both the category archive page and all individual posts marked with specific categories.
<?php if ( is_front_page() ) : ?><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/specific image for cat">
<?php elseif ( is_category( 'category 1' ) || has_category ('category 1')) : ?>
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/specific image for cat">
<?php elseif ( is_category( 'category 2' ) || has_category ('category 2')) : ?>
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/specific image for cat">
<?php elseif ( is_category( 'category 3' ) || has_category ('category 3')) : ?>
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/specific image for cat">
<?php elseif ( is_category( 'other' ) ) : ?>
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/specific image for cat">
<?php else: ?>
@grtaylor2
grtaylor2 / gist:4504569
Last active December 10, 2015 22:48
Ustream Embed to WordPress
<iframe style="border: 0px none transparent;" src="http://www.ustream.tv/embed/your specific id#" frameborder="0" scrolling="no" width="525" height="333"></iframe><a style="padding: 2px 0px 4px; width: 525px; background: #ffffff; display: block; color: #000000; font-weight: normal; font-size: 10px; text-decoration: underline; text-align: center;" href="Destination Link" target="_blank">Link Anchor Text</a>
/*Adding the social stream -- specify width that's specific to your site*/
<iframe width="330" scrolling="no" height="625" frameborder="0" style="border: 0px none transparent;" src="http://www.ustream.tv/socialstream/your specific id#">
@grtaylor2
grtaylor2 / GenesisPostMeta
Last active December 14, 2015 10:49
Change WordPress Post Meta For Genesis Framework
/** Customize the post meta function */
add_filter( 'genesis_post_meta', 'post_meta_filter' );
function post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before="CUSTOM CATEGORY NAME"] [post_tags before="CUSTOM TAG NAME"]';
return $post_meta;
@grtaylor2
grtaylor2 / Change Read More Text Genesis WordPress
Last active August 11, 2021 19:53
Change the [Read More] Text in Genesis WordPress Child Theme
/** Customize Read More Text */
add_filter( 'excerpt_more', 'child_read_more_link' );
add_filter( 'get_the_content_more_link', 'child_read_more_link' );
add_filter( 'the_content_more_link', 'child_read_more_link' );
function child_read_more_link() {
return '<a href="' . get_permalink() . '" rel="nofollow">CUSTOMIZE YOUR TEXT HERE</a>';
}
@grtaylor2
grtaylor2 / Removing Blog Post From Home Page in Genesis
Last active May 5, 2017 07:59
Removing Blog Post From Home Page in Genesis
/** Removing Blog Post From Home Page */
remove_action( 'genesis_loop', 'genesis_do_loop' );add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
genesis();
@grtaylor2
grtaylor2 / gist:5960970
Created July 9, 2013 20:26
Code to DELETE from home.php file to remove blog posts from Genesis Minimum home page layout.
add_action( 'genesis_loop', 'minimum_grid_loop_helper' );
function minimum_grid_loop_helper() {
if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 0,
'feature_image_size' => 'featured',
'feature_image_class' => 'post-image',
'feature_content_limit' => 0,
'grid_image_size' => 0,
@grtaylor2
grtaylor2 / gist:6072596
Created July 24, 2013 17:21
Change Default Genesis Comment Tagline "Speak Your Mind"
/* Change default comment Speak Your Mind */
function change_default_comment_text($args) {
$args['title_reply'] = 'Leave a Comment';
return $args;
}
add_filter( 'genesis_comment_form_args', 'change_default_comment_text' );
@grtaylor2
grtaylor2 / gist:6313917
Created August 22, 2013 23:17
Enable specific phone numbers on page
Add to the page or it will detect any ph# on page and make it clickable for iPhone.
<meta name="format-detection" content="telephone=no">
Then wrap specified phone number:
<a href="tel:1-800-555-5555">Anchor to any words or combo of numbers and/or letters</a>
/* Color Buttons
------------------------------------------------------------ */
.button-blue,
.button-gray,
.button-green,
.button-purple,
.button-red,
.button-yellow {
color: #fff;
@grtaylor2
grtaylor2 / woocommerce.css
Created November 29, 2013 19:21
Clean Woo Commerce CSS -- Replace the plugin's woocommerce.css file with a decompressed formatted stylesheet. This is the original CSS with no edits -- the code is just formatted in a way that makes edits much easier.
/*Stylesheet cleaned up and organized by Marketing Press*/
.clear {
clear:both
}
.nobr {
white-space:nowrap;
}