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
jQuery(document).ready(function($){ | |
//for old IE browser people | |
if(jQuery.support.opacity == false){ | |
//If opacity is false, it's assumed that the browser is <= IE8 | |
//In this case, the site is not responsive for these browsers & | |
//columns are set to the height of the greatest column in all cases | |
if( $( '.half' ).height() > $( '.half_right' ).height()) { |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/***Enable Excerpts on Pages***/ | |
add_action('init', 'page_excerpts'); | |
function page_excerpts() { | |
add_post_type_support( 'page', 'excerpt' ); | |
} |
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
/***Category Page Title****/ | |
function add_category_page_title() { | |
$cat = get_category( get_query_var( 'cat' ) );/* gets the category info of the current archive page*/ | |
$cat_name = $cat->name; /*pass the value of the category to name, and attach this to the variable*/ | |
?><h2>Articles categorised as: <?php echo $cat_name;?></h2> /*build the headline*/ | |
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
/***Tidy Up Dashboard widgets***/ | |
function disable_dashboard_widgets() { | |
remove_meta_box('dashboard_right_now', 'dashboard', 'core'); | |
remove_meta_box('dashboard_recent_comments', 'dashboard', 'core'); | |
remove_meta_box('dashboard_incoming_links', 'dashboard', 'core'); | |
remove_meta_box('dashboard_plugins', 'dashboard', 'core'); | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'core'); | |
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core'); | |
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 REPEATER FIELD FOR UPLOADED FILES****/ | |
function add_project_downloads() { | |
if(get_field('worksheets')): ?> | |
<h3 class="no_top_margin">Download Worksheets for this Lesson</h3> | |
<ul> | |
<?php while(has_sub_field('worksheets')): ?> |
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 | |
// fancy PHP 5.3+ style | |
add_action( 'template_redirect', function() { | |
if ( ! is_user_logged_in() ) { | |
wp_redirect( wp_login_url() ); | |
exit; | |
} | |
} ); |
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 for calculating heights | |
//******************************************************** | |
function equalHeight(group) { | |
var tallest = 0; | |
group.each(function() { | |
var thisHeight = jQuery(this).height(); | |
if(thisHeight > tallest) { | |
tallest = thisHeight; |
OlderNewer