Skip to content

Instantly share code, notes, and snippets.

@shazdeh
shazdeh / gist:8151589
Created December 27, 2013 19:40
Parallax: hide the header on a specific page (http://themify.me/docs/post-page-id) but keep the menu
.page-id-69 #header hgroup {
display: none;
}
.page-id-69 #headerwrap {
height: 0;
}
.page-id-69 #nav-bar {
top: 0;
bottom: auto;
}
@shazdeh
shazdeh / gist:8188033
Created December 30, 2013 20:58
Change default parameters of the gallery shortcode, disable links by default
<?php
function gallery_shortcode_defaults( $out, $pairs, $atts ) {
$out['link'] = 'none';
return $out;
}
add_filter( 'shortcode_atts_gallery', 'gallery_shortcode_defaults', 10, 3 );
@shazdeh
shazdeh / gist:8190595
Created December 31, 2013 00:41
Builder: break 4 column grids to 2 columns in tablets
@media (min-width: 480px) and (max-width: 959px) {
.col4-1 {
width: 46.8%;
}
.col4-1:nth-child(2n+1) {
margin-left: 0;
}
}
@shazdeh
shazdeh / gist:8242672
Last active January 2, 2016 03:19
Pinshop: enable the right sidebar on product category pages
<?php
function custom_product_category_layout( $class ) {
if( themify_is_function('is_product_category') ) {
$class = 'sidebar1';
}
return $class;
}
add_filter( 'themify_default_layout', 'custom_product_category_layout' );
@shazdeh
shazdeh / gist:8290250
Created January 6, 2014 21:39
Highlight current post in the loop
<?php
function highlight_current_post( $classes ) {
global $post, $wp_query;
if( $post->ID == $wp_query->post->ID ) {
$classes[] = 'current-post';
}
return $classes;
@shazdeh
shazdeh / gist:8322030
Created January 8, 2014 18:42
Parallax: have the logo be displayed in the fixed navbar
.fixed-nav-bar + #skrollr-body hgroup {
-webkit-transform: inherit !important;
-moz-transform: inherit !important;
}
.fixed-nav-bar + #skrollr-body #site-logo {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
}
@shazdeh
shazdeh / gist:8479479
Created January 17, 2014 19:09
Flat: make section backgrounds cover the entire section
.sidebar-none.list-post .section {
background-position: center;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@shazdeh
shazdeh / gist:8528197
Last active January 3, 2016 22:28
Flatshop: use the product image as the background image when no background image is specified.
<?php
function custom_product_default_bg_image() {
$bg_image = themify_get( 'background_image' );
if( ! $bg_image ) {
global $post;
$thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(),'shop_single', true );
echo "<style> .post-{$post->ID} .product-bg { background-image: url('{$thumb_url[0]}'); } </style>";
}
}
@shazdeh
shazdeh / gist:8584331
Created January 23, 2014 18:40
Justified menu
#main-nav {
width: 100%;
}
#main-nav > li {
float: none;
display: table-cell;
width: 1%;
}
#main-nav:after,
#main-nav:before {
@shazdeh
shazdeh / gist:8585694
Created January 23, 2014 19:57
Parallax: display header slider controller buttons at the bottom of header
#gallery-controller .slider .slides {
position: absolute;
bottom: 100px;
top: auto !important;
left: 50% !important;
overflow: hidden;
width: 100px !important;
margin-left: -50px !important;
}
#gallery-controller .caroufredsel_wrapper,