Skip to content

Instantly share code, notes, and snippets.

add_filter( 'genesis_pre_get_option_site_layout', 'home_page_layout' );
/**
* Force full width content on Genesis Framework home page.
*/
function home_page_layout() {
if ( is_front_page() && is_home() ) {
// Default homepage ( both the front page and the recent posts page)
} elseif ( is_front_page() ) {
/*
** Conditionally force the Genesis Framework Layout on specific post types including Custom Post Types (CPTs)
**
** Instructions:
** 1) Replace themeprefix with your own prefix
** 2) Keep or replace post types inside array brackets. The example placeholder here is "treatment".
**
** Source: https://wpbeaches.com/force-custom-post-type-certain-layout-genesis-theme-wordpress/
*/
@markdeafmcguire
markdeafmcguire / display-cpt-in-tag-archives.php
Last active July 21, 2020 17:04
Add filter to check for tag 'cpacc' before running query to include CPT 'drafts' in archive loop
// ADD FILTER TO SHOW CPT IN TAG ARCHIVES
add_filter( 'pre_get_posts', 'tag_archives_show_cpts' );
function tag_archives_show_cpts( $query ) {
if( is_tag('') &&
empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'post_type', array( 'post', 'nav_menu_item', 'drafts'));
return $query;
@markdeafmcguire
markdeafmcguire / .gitignore
Created September 12, 2019 02:40 — forked from salcode/.gitignore
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.

Keybase proof

I hereby claim:

  • I am markdeafmcguire on github.
  • I am markdeafmcguire (https://keybase.io/markdeafmcguire) on keybase.
  • I have a public key ASDAKkWI3zURPw-oT027Acs_pzxw41MP3mOM-8_Gv1eSZgo

To claim this, I am signing this object: