Skip to content

Instantly share code, notes, and snippets.

@shazdeh
shazdeh / gist:9145929
Created February 21, 2014 23:33
Parallax: Add a down arrow in the header for scrolling pages.
<?php
function custom_down_arrow() {
global $themify;
if( '' != $themify->query_category && 'section' == $themify->query_post_type ) {
echo '<a href="#body" id="arrow-down" style="position: absolute; left: 50%; bottom: 100px; color: #fff; font-size: 25px;"><i class="fa fa-arrow-circle-down"></i></a>';
}
}
add_action( 'themify_header_end', 'custom_down_arrow' );
@shazdeh
shazdeh / gist:8852114
Last active August 29, 2015 13:56
Disable "URL" field from comments form
<?php
function custom_comment_form_fields( $fields ) {
unset( $fields['url'] );
return $fields;
}
add_filter( 'comment_form_default_fields', 'custom_comment_form_fields' );
@shazdeh
shazdeh / gist:8831437
Last active August 29, 2015 13:56
Fullpane: reverse the location of header and footer
Implemented in the theme.
@shazdeh
shazdeh / gist:8802568
Created February 4, 2014 12:13
Register an image size as public
<?php
function custom_themify_extend_image_sizes( $sizes ) {
$sizes['extralarge'] = __( 'Extra Large', 'themify' );
return $sizes;
}
add_filter( 'image_size_names_choose', 'custom_themify_extend_image_sizes' );
@shazdeh
shazdeh / gist:8721416
Created January 30, 2014 22:29
Features and Bottom widget areas
<?php
add_action( 'widgets_init', 'register_layout_widget_areas' );
add_action( 'themify_layout_before', 'display_features_area' );
add_action( 'themify_layout_after', 'display_bottom_area' );
function register_layout_widget_areas() {
register_sidebar(array(
'name' => __( 'Features' ),
'id' => 'features',
@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,
@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: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: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: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;
}