Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: Themify WPTouch Compatibility
Description: This plugin makes Builder in Themify framework compatible with the WPTouch plugin.
*/
function themify_wptouch_compat() {
$theme_root = wp_get_theme()->get_template_directory();
if( ! is_admin()
&& wptouch_is_mobile_theme_showing()
@shazdeh
shazdeh / gist:fe2115181cb1ce45dc23
Created August 2, 2014 13:35
Basic table styles
table {
width: 100%;
max-width: 100%;
margin-bottom: 20px;
}
table > thead > tr > th,
table > tbody > tr > th,
table > tfoot > tr > th,
table > thead > tr > td,
table > tbody > tr > td,
@shazdeh
shazdeh / gist:5735418c103a4409097d
Last active August 29, 2015 14:01
grid5 style
.shortcode.loops-wrapper.grid5 .post {
opacity: 1 !important;
width: auto;
float: none;
margin: 0;
}
@media (min-width: 831px) {
.shortcode.loops-wrapper.grid5 .post {
width: 17.4%;
@shazdeh
shazdeh / gist:10376522
Last active August 29, 2015 13:58
WordPress gallery: enable linking images to different URLs
<?php
class Gallery_Images_Links {
public function __construct() {
add_filter( 'attachment_link', array( $this, 'attachment_link' ), 10, 2 );
add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 20, 2 );
add_filter( 'attachment_fields_to_save', array( $this, 'attachment_fields_to_save' ), 10, 2 );
}
@shazdeh
shazdeh / gist:9775707
Created March 26, 2014 02:12
Parallax: unlink portfolio images in the portfolio expander and single portfolio views
<?php
function custom_unlink_portfolio_images() {
global $post, $themify;
if( $post->post_type == 'portfolio' ) {
if( is_singular( 'portfolio' ) || ( ! empty( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) && strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ]) == 'xmlhttprequest' ) ) {
$themify->unlink_image = 'yes';
}
}
@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%;
}
@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: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: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' );