Skip to content

Instantly share code, notes, and snippets.

View richtabor's full-sized avatar

Rich Tabor richtabor

View GitHub Profile
/*===================================================================*/
/* SEARCH FILTER
/*===================================================================*/
if ( !function_exists( 'bean_search_filter' ) )
{
function bean_search_filter($query)
{
if ( !$query->is_admin && $query->is_search)
{
//UNCOMMENT BELOW TO SEARCH FOR POSTS ONLY
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'bean' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
@richtabor
richtabor / AddingToHomeURL
Created July 2, 2014 13:49
When you need to append something to your WordPress home URL
<?php echo home_url('/?'); ?>
<?php $terms = get_the_terms( $post->ID, 'portfolio_category' ); ?>
<?php if ( $terms && ! is_wp_error( $terms ) ) : ?>
<li><?php the_terms($post->ID, 'portfolio_category', '', ', ', ''); ?></li>
<?php endif;?>
<div class="overlay">
<h5>
<a title="<?php printf(__('Permanent Link to %s', 'bean'), get_the_title()); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h5>
</div>
/* Masonry Grids */
.masonry-item {
padding: 15px; /* Adjust this padding here to add/subtract from the gutter */
width: 50%;
}
/* Portfolio Grids (Floating) */
#load-more .portfolio,
.products li .portfolio,
.products li .portfolio:hover img,
.widget_bean_portfolio li:hover img,
li.masonry-item.grid-masonry:hover img,
#portfolio-grid li .portfolio:hover img,
.hidden-sidebar.dark .bean-shot:hover img,
.hidden-sidebar.dark .flickr_badge_image:hover img,
.hidden-sidebar.dark .bean500px_badge_image:hover img,
.hidden-sidebar.dark .instagram_badge_image:hover img{
opacity: 0.1;
-webkit-transform:scale(1.0)!important;
<title><?php wp_title( '|', true, 'right' ); ?></title>
/*===================================================================*/
/* ONLY SEARCH POSTS
/*===================================================================*/
function bean_search_filter($query)
{
if ( !$query->is_admin && $query->is_search)
{
//UNCOMMENT BELOW TO SEARCH FOR POSTS ONLY
//$query->set('post_type', 'post' );
@richtabor
richtabor / Exclude a Portfolio Category from your Loop
Created August 26, 2014 13:49
Add this to your $args Portfolio Loop Query (like this: http://thmbns.co/XEj4) to exclude a specific category from your portfolio loop.
'tax_query' => array(
array(
'taxonomy' => 'portfolio_category',
'field' => 'slug',
'terms' => 'print',
'operator' => 'NOT IN',
),
),