This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].
-
[You Don't Know JS][3]
-
[Frontend Masters courses by Kyle Simpson][12]
-
[@mpjme][6]'s [YouTube videos][5]
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' ); | |
function custom_pre_get_posts_query( $q ) { | |
if ( ! $q->is_main_query() ) return; | |
if ( ! $q->is_post_type_archive() ) return; | |
if ( ! is_admin() && is_shop() ) { | |
$q->set( 'tax_query', array(array( |
/* =BEGIN: Check If Page Is Child | |
Source: http://bavotasan.com/2011/is_child-conditional-function-for-wordpress/ | |
---------------------------------------------------------------------------------------------------- */ | |
function is_child( $page_id_or_slug ) { // $page_id_or_slug = The ID of the page we're looking for pages underneath | |
global $post; // load details about this page | |
if ( !is_numeric( $page_id_or_slug ) ) { // Used this code to change a slug to an ID, but had to change is_int to is_numeric for it to work. | |
$page = get_page_by_path( $page_id_or_slug ); | |
$page_id_or_slug = $page->ID; | |
} |
/*-----------------------------------------------------------------------------------*/ | |
/* The Events Calendar - Conditional Logic to Detect Various Event Related Views/Pages | |
/*-----------------------------------------------------------------------------------*/ | |
if ( tribe_is_month() && ! is_tax() ) { // Month View Page | |
echo 'were on the month view page'; | |
} elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page |
Enough people loved this gist, so it's now a Github repository!
⭐ Please use the "The Events Calendar Reset" on Github going forward. ⭐