Skip to content

Instantly share code, notes, and snippets.

@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: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:8831437
Last active August 29, 2015 13:56
Fullpane: reverse the location of header and footer
Implemented in the theme.
@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: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:9365953
Created March 5, 2014 12:05
WPML body classes
<?php
function append_language_class( $classes ) {
$classes[] = ICL_LANGUAGE_CODE;
return $classes;
}
add_filter( 'body_class', 'append_language_class' );
@shazdeh
shazdeh / gist:9419457
Created March 7, 2014 20:33
Parallax: have the logo be displayed in the fixed header
#header hgroup {
-webkit-transform: inherit !important;
-moz-transform: inherit !important;
position: relative;
z-index: 99999;
}
.fixed-header-on #site-logo {
position: fixed;
top: 0;
left: 0;
@shazdeh
shazdeh / gist:9439247
Created March 8, 2014 21:35
parallax: move menu to the top of the page
#nav-bar {
top: 0;
bottom: auto;
position: fixed;
}
.admin-bar #nav-bar {
top: 32px;
}
.home #main-nav ul {
bottom: auto;
@shazdeh
shazdeh / gist:9554452
Created March 14, 2014 19:00
JetPack Infinite Scroll support for Themify themes
<?php
function themify_infinite_scroll_init() {
add_theme_support( 'infinite-scroll', array(
'container' => 'loops-wrapper',
'render' => 'themify_infinite_scroll_render'
) );
}
add_action( 'after_setup_theme', 'themify_infinite_scroll_init' );
@shazdeh
shazdeh / gist:9551646
Created March 14, 2014 16:47
Pinboard: fluid layout
.pagewidth {
width: 94%;
}
@media (min-width: 771px) {
#content {
width: 75%;
}
#sidebar {
width: 22%;
}