This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter out the html for fields if they should be hidden from users logged in or out. | |
*/ | |
function _avm_dym_gform_field_content( $content, $field, $value, $zero, $form_id ) { | |
if( is_admin() ) | |
return $content; | |
if( !empty( $field['hideIfLoggedIn'] ) && is_user_logged_in() ) | |
return ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hide modal on ajax submit | |
$('#gform_id').on('submit', function(){ | |
$.post("/#gf_id", $(this).serialize(), function(){ | |
var delay = 6000; | |
setTimeout(function(){ | |
$("#modalID").modal('hide'); | |
//window.location.href = 'success.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* WordPress Sample function and action | |
* for loading scripts in themes | |
*/ | |
add_action( 'wp_enqueue_scripts', 'wptuts_styles_with_the_lot' ); | |
function wptuts_styles_with_the_lot() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery isVisible script - bg color swap | |
var win = $(window); | |
var allMods = $(".featurette"); | |
allMods.each(function(i, el) { | |
var el = $(el); | |
if (el.visible(false, true)) { | |
//el.addClass("colorize"); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Determining the domain - DO NOT EDIT */ | |
$host = $HTTP_HOST; | |
$parts = explode('.',$host); | |
if ($parts[3] = "") { | |
$domain = $parts[0]; | |
} else { | |
$domain = $parts[1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Disable support for comments and trackbacks in post types | |
function df_disable_comments_post_types_support() { | |
$post_types = get_post_types(); | |
foreach ($post_types as $post_type) { | |
if(post_type_supports($post_type, 'comments')) { | |
remove_post_type_support($post_type, 'comments'); | |
remove_post_type_support($post_type, 'trackbacks'); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
|| location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pw_show_gallery_image_urls( $content ) { | |
global $post; | |
// Only do this on singular items | |
if( ! is_singular() ) | |
return $content; | |
// Make sure the post has a gallery in it | |
if( ! has_shortcode( $post->post_content, 'gallery' ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function get_form_summary(){ | |
global $wpdb; | |
$form_table_name = self::get_form_table_name(); | |
$lead_table_name = self::get_lead_table_name(); | |
$sql = "SELECT l.form_id, count(l.id) as unread_count | |
FROM $lead_table_name l | |
WHERE is_read=0 AND status='active' | |
GROUP BY form_id"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WP_Query arguments | |
$args = array ( | |
'category_name' => 'gallery', | |
); | |
// The Query | |
$query = new WP_Query( $args ); | |
// The Loop | |
if ( $query->have_posts() ) { |