Skip to content

Instantly share code, notes, and snippets.

@shazdeh
Created November 18, 2013 20:44
Show Gist options
  • Save shazdeh/7534976 to your computer and use it in GitHub Desktop.
Save shazdeh/7534976 to your computer and use it in GitHub Desktop.
Enable the right sidebar on single portfolio pages (Parallax)
<?php
function custom_body_classes( $classes ) {
if( is_singular( 'portfolio' ) ) {
$id = array_search( 'sidebar-none', $classes );
unset( $classes[$id] );
$classes[] = 'sidebar1';
}
return $classes;
}
add_filter( 'themify_body_classes', 'custom_body_classes' );
function change_portfolio_singular_layout() {
global $themify;
if( is_singular( 'portfolio' ) ) {
$themify->layout = 'sidebar-1';
}
}
add_action( 'themify_content_after', 'change_portfolio_singular_layout' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment