This file contains 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 | |
global $wp_query; | |
if( empty($wp_query->post->post_parent) ) { | |
$parent = $wp_query->post->ID; | |
} else { | |
$parent = array_reverse(get_post_ancestors($post->ID)); | |
$parent = $parent[0]; | |
} | |
if(wp_list_pages("title_li=&child_of=$parent&echo=0" )) { | |
?> |
This file contains 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
/** | |
* Process meta | |
* | |
* Processes the custom tab options when a post is saved | |
*/ | |
function process_product_meta_custom_tab($post_id) { | |
update_post_meta($post_id, 'custom_tab_enabled', (isset ($_POST['custom_tab_enabled']) && $_POST['custom_tab_enabled']) ? 'yes' : 'no'); | |
update_post_meta($post_id, 'custom_tab_title', $_POST['custom_tab_title']); | |
update_post_meta($post_id, 'custom_tab_content', $_POST['custom_tab_content']); | |
} |
This file contains 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 is_blog() { | |
global $post; | |
//Post type must be 'post'. | |
$post_type = get_post_type($post); | |
//Check all blog-related conditional tags, as well as the current post type, | |
//to determine if we're viewing a blog page. | |
return ( |
This file contains 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 gvi_slider(el, t, c) { | |
var $slides = $(el); | |
(function _loop(idx) { | |
$slides.removeClass(c).eq(idx).addClass(c); | |
setTimeout(function () { | |
_loop((idx + 1) % $slides.length); | |
}, t); | |
}(0)); | |
} |
This file contains 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
var animatedHeader = (function() { | |
var docElem = document.documentElement, | |
header = document.querySelector( '.site-header' ), | |
didScroll = false, | |
changeHeaderOn = 1; | |
function init() { | |
window.addEventListener( 'scroll', function( event ) { | |
if( !didScroll ) { |
This file contains 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
// REMOVE THE WORDPRESS UPDATE NOTIFICATION FOR ALL USERS EXCEPT SYSADMIN | |
global $user_login; | |
get_currentuserinfo(); | |
if (!current_user_can('update_plugins')) { // checks to see if current user can update plugins | |
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); | |
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); | |
} |
This file contains 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 update notifications | |
*/ | |
add_action('admin_menu','wphidenag'); | |
function wphidenag() { | |
remove_action( 'admin_notices', 'update_nag', 3 ); | |
} | |
/** | |
* Hide plugin update notifications |
This file contains 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
add_filter( 'wpcf7_validate_text', 'your_validation_filter_func', 10, 2 ); | |
add_filter( 'wpcf7_validate_text*', 'your_validation_filter_func', 10, 2 ); | |
function your_validation_filter_func( $result, $tag ) { | |
$type = $tag['type']; | |
$name = $tag['name']; | |
if ( 'your-id-number-field' == $name ) { | |
$the_value = $_POST[$name]; |
OlderNewer