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 | |
/** | |
* Checks if current post is a custom post type, returns boolean | |
* | |
* @author Joshua David Nelson | |
* @link http://joshuadnelson.com/code/is_custom_post_type/ | |
*/ | |
if ( !function_exists( 'is_custom_post_type' ) ) { | |
function is_custom_post_type() { |
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 | |
/** | |
* Check if post type supports an archive | |
* | |
* @param string $post_type post type name | |
* @uses get_post_type | |
* @global object $post | |
* @returns boolean | |
* @author Joshua David Nelson | |
*/ |
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 in-post layout support for 'product' post type | |
* | |
* @link http://www.studiograsshopper.ch/web-development/how-to-use-genesis-connect-for-woocommerce/#gcw-remove-layouts | |
*/ | |
add_action( 'init', 'child_remove_post_type_support' ); | |
function child_remove_post_type_support() { | |
remove_post_type_support( 'product', 'genesis-layouts' ); | |
} |
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 | |
/** | |
* Remove Post Metaboxes on a specific post | |
* | |
* @link http://wordpress.stackexchange.com/questions/74280/remove-metabox-from-specific-page-template-in-admin#74283 | |
*/ | |
add_action( 'admin_menu', 'jdn_remove_post_meta_boxes' ); | |
function jdn_remove_post_meta_boxes() |
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 | |
/** | |
* Exclude scripts from Scripts to Footer plugin | |
* http://wordpress.org/plugins/scripts-to-footerphp/ | |
* | |
* In this example, we will use jQuery (hosted on Google's servers even) | |
*/ | |
add_action( 'wp_print_styles', 'jdn_deregister_scripts', 100 ); | |
add_action( 'wp_head', 'jdn_head_scripts' ); |
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 | |
// Set which users to hide box | |
add_action( 'admin_init', 'jdn_remove_bio_box' ); | |
function jdn_remove_bio_box() { | |
if( !current_user_can( 'edit_published_posts' ) ) { | |
add_action( 'personal_options', array ( 'JDN_Hide_Profile_Bio_Box', 'start' ) ); | |
} | |
} |
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 | |
// Change Comments byline | |
add_filter( 'genesis_post_info', 'jdn_ticket_info_filter' ); | |
function jdn_ticket_info_filter( $post_info ) { | |
if( get_post_type() == 'ticket' ) { | |
$post_info = 'Ticket Opened: [post_date] [post_comments zero="Reply" one="1 Reply" more="% Replies"]'; | |
} else { | |
$post_info = 'Posted [post_date] by [post_author] [post_comments zero="Leave a Comment" one="1 Comment" more="% Comments"]'; | |
} |
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 | |
/** | |
* Force Genesis Admin Settings for all administrators | |
**/ | |
// Force Genesis on Admin | |
add_action( 'admin_init', 'jdn_force_genesis_admin' ); | |
function jdn_force_genesis_admin() { | |
if( current_user_can( 'create_users' ) ) { // If this is an Admin | |
$user_id = get_current_user_id(); |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
/** | |
* Project Quote | |
* | |
*/ | |
function be_project_quote() { | |
global $wp_query, $be_testimonials; | |
if( !( ( 5 < $wp_query->found_posts && 5 == $wp_query->current_post % 6 ) || ( $wp_query->current_post == ( $wp_query->found_posts - 1 ) && 5 > $wp_query->found_posts ) ) ) |