Skip to content

Instantly share code, notes, and snippets.

View richtabor's full-sized avatar

Rich Tabor richtabor

View GitHub Profile
@richtabor
richtabor / Child Theme Style.css Starter
Created September 1, 2014 17:53
The header for child themes. Make sure to modify the template variable and the @import url to match your current theme name.
/*
Theme Name: Macho Child Theme
Theme URI: http://demo.themebeans.com/macho
Description: Make your modifications to this child theme.
Author: Rich Tabor / ThemeBeans
Author URI: http://themebeans.com
Version: 1.0
Template: macho
*/
@richtabor
richtabor / Add Portfolio Category Title to Archive
Created September 8, 2014 11:00
Add this to archive-portfolio.php, on line 24
<?php if ( is_post_type_archive('portfolio') OR is_tax() ) { ?>
<div class="block portfolio-archive">
<h1 class="entry-title">
<?php
if ( is_post_type_archive('portfolio') ) {
post_type_archive_title();
} elseif ( get_the_terms($post->ID, 'portfolio_tag') ) {
printf( __( '%s', 'bean' ), single_tag_title( '', false ) . '' );
} elseif (get_the_terms($post->ID, 'portfolio_category')) {
.products li .portfolio:hover img,
.widget_bean_portfolio li:hover img,
#portfolio-grid li .portfolio:hover img,
li.masonry-item.grid-masonry:hover img {
-webkit-transform:scale(1.0)!important;
-moz-transform:scale(1.0)!important;
-o-transform:scale(1.0)!important;
transform:scale(1.=)!important;
}
<?php the_time(get_option('date_format')); ?>
//BACKGROUND SUPPORT
add_theme_support( 'custom-background' );
@richtabor
richtabor / register-nav-menu-example.php
Last active June 17, 2016 16:01
Register Nav Menu Example
register_nav_menus( array(
'primary-menu' => __( 'Primary Navigation', 'bean' ),
'mobile-menu' => __( 'Mobile Navigation', 'bean' ),
));
@richtabor
richtabor / gist:52bb45983ad0be597a64
Created January 23, 2015 14:26
Hide CPT single views
/*===================================================================*/
/* NO SINGLE VIEW FOR TEAM AND TESTIMONIAL POSTS
/*===================================================================*/
function bean_no_single_cpt_redirect()
{
if ( is_single() && 'testimonial' == $queried_post_type ) {
wp_redirect( home_url(), 301 );
exit;
}
} //END function bean_no_single_cpt_redirect()
@richtabor
richtabor / gist:8d8612f9cca006d192e6
Last active August 29, 2015 14:20
bean_custom_form_filters fix - Basically add these keys and values to the $defaults array in the bean_custom_form_filters function, located within functions.php
'id_submit' => 'submit',
'class_submit' => 'submit',
'name_submit' => 'submit',
'submit_field' => '<p class="form-submit">%1$s %2$s</a>',
'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />',
@richtabor
richtabor / gist:106598ec31f33a195e2d
Created April 30, 2015 13:11
Portfolio Post Type (Bean Portfolio Plugin) categorized pagination
<?php previous_post_link( '%link', __('Previous', 'bean'), TRUE, '', 'portfolio_category'); ?>
<?php next_post_link( '%link', __('Next', 'bean'), TRUE, '', 'portfolio_category'); ?>
body .postcount {
display:none;
}