Skip to content

Instantly share code, notes, and snippets.

View RichKenyon's full-sized avatar

Rich Kenyon RichKenyon

  • Kenyon Digital
  • Rochester, NY
View GitHub Profile
@RichKenyon
RichKenyon / wp_blog_nav_classes_fix_for_cpt.php
Created February 20, 2019 17:04
Removes 'current_page_parent' nav class from blog landing page when in custom post type
<?php
function my_custom_post_type_nav_classes( $classes, $item ) {
$custom_post_type = 'custom-post-type';
if( ( is_post_type_archive( $custom_post_type) || is_singular( $custom_post_type ) )
&& get_post_meta( $item->ID, '_menu_item_object_id', true ) == get_option( 'page_for_posts' ) ){
$classes = array_diff( $classes, array( 'current_page_parent' ) );
}
return $classes;
}
add_filter( 'nav_menu_css_class', 'my_custom_post_type_nav_classes', 10, 2 );
@RichKenyon
RichKenyon / gutenberg-mixins.scss
Last active January 25, 2020 00:53
Gutenberg Sass Mixins for Bootstrap
$gutenberg_colors:
(gray-100, $gray-100),
(gray-200, $gray-200),
(gray-300, $gray-300),
(gray-400, $gray-400),
(primary, $primary),
(primary-light, $primary-light),
(primary-dark, $primary-dark),
(secondary, $secondary-dark),
(accent, $accent),
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(