Skip to content

Instantly share code, notes, and snippets.

@shazdeh
shazdeh / gist:7288642
Created November 3, 2013 10:12
Customizing date formats. PHP reference: http://php.net/manual/en/function.date.php
<?php
function custom_date_format( $format ) {
return 'M j, Y';
}
add_filter( 'themify_loop_date', 'custom_date_format' );
@shazdeh
shazdeh / gist:7288662
Created November 3, 2013 10:14
Filtering options in a Themify theme. The $options variable is an array of saved options.
<?php
$theme = wp_get_theme();
function filter_theme_options( $options ) {
return $options;
}
add_filter( 'option_' . $theme->display('Name') . '_themify_data', 'filter_theme_options' );
@shazdeh
shazdeh / gist:7291432
Created November 3, 2013 15:25
Disabling the post edit links from frontpage
<?php
if( ! is_admin() ) {
add_filter( 'get_edit_post_link', '__return_null' );
}
function restore_admin_bar_edit_link() {
remove_filter( 'get_edit_post_link', '__return_null' );
}
add_action( 'wp_footer', 'restore_admin_bar_edit_link' );
@shazdeh
shazdeh / gist:7291827
Last active December 27, 2015 07:49
Customizing the site titles per-page using a custom field
<?php
function custom_site_title( $html, $location, $logo_tag, $type ) {
global $post;
if( is_singular() && $custom_title = get_post_meta( $post->ID, 'site_title', true ) ) {
$title = get_bloginfo('name');
$html = str_replace( $title, $custom_title, $html );
}
return $html;
}
@shazdeh
shazdeh / gist:7332067
Created November 6, 2013 07:01
Disable the Builder frontpage editor
<?php
function disable_frontend_builder() {
global $ThemifyBuilder;
if( ! is_admin() ) {
remove_action( 'wp_enqueue_scripts', array( $ThemifyBuilder, 'load_front_js_css' ), 10 );
remove_action( 'wp_before_admin_bar_render', array( $ThemifyBuilder, 'builder_admin_bar_menu'), 1000 );
}
}
@shazdeh
shazdeh / gist:7341755
Last active December 27, 2015 14:39
Simple dropdowns using the Custom Menu widget
.menu > li {
display: inline-block;
position: relative;
}
.menu > li > a {
padding: 5px 10px;
display: inline-block;
}
.menu li ul {
display: none;
@shazdeh
shazdeh / gist:7343690
Created November 6, 2013 20:40
Display a gallery in lightbox! Cool effect.
<a class="lightbox" href="#gallery1" rel="prettyPhoto"> Open Gallery </a>
<div id="gallery1" style="display: none;">
<!-- add the [gallery] shortcode here -->
</div>
@shazdeh
shazdeh / gist:7354290
Last active December 27, 2015 16:19
Clean accordion style. Removes the default styles of the accordion modules in Builder.
.module.module-accordion.clean,
.module.module-accordion.clean ul,
.module.module-accordion.clean li,
.module.module-accordion.clean .accordion-title,
.module.module-accordion.clean li:hover .accordion-title,
.module.module-accordion.clean .accordion-content,
.module.module-accordion.clean li.current,
.module.module-accordion.clean li.current .accordion-content {
background: none;
border: none;
@shazdeh
shazdeh / gist:7367465
Created November 8, 2013 07:28
Content widget areas. Registers two widget areas that are displayed above and below the main content area.
<?php
add_action( 'widgets_init', 'register_content_widget_areas' );
add_action( 'themify_content_start', 'display_content_top_area' );
add_action( 'themify_content_end', 'display_content_bottom_area' );
function register_content_widget_areas() {
register_sidebar(array(
'name' => __( 'Content Top' ),
'id' => 'content-top',
@shazdeh
shazdeh / gist:7376005
Last active December 27, 2015 19:19
Left align the header elements in Parallax theme
#site-logo,
#site-description,
.social-widget,
#header #searchform {
text-align: left;
text-indent: 5%;
margin-left: 0;
}
.widget.themify-social-links {
text-indent: 0;