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 | |
/** | |
* 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 ) ) ) |
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 | |
/** | |
* Adds classes to your posts for a specific page (say, a custom post type archive for instance) | |
* | |
* @author Joshua David Nelson, joshuadnelson.com | |
**/ | |
// Three Columns | |
function jdn_code_archive_post_class( $classes ) { | |
$classes[] = 'one-third teaser'; // classes, these turn the format into three columns |
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 | |
/** | |
* Check is post is the child, sibling or the parent. | |
* | |
* Modified from http://css-tricks.com/snippets/wordpress/if-page-is-parent-or-child/ | |
**/ | |
function is_branch( $pid ) { // Check if parent or child | |
global $post; | |
if( is_page() && is_int( $pid ) && ( $post->post_parent == $pid || is_page( $pid ) ) ) { |
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
/** | |
* This is the correct method of using wp_editor() | |
**/ | |
// Codex usage: | |
wp_editor( $content, $editor_id, $settings = array() ); | |
// Example of proper use in a widget | |
wp_editor( 'content', 'content', array( 'textarea_name' => $this->get_field_id( 'content' ), ) ); | |
// Alternate method when get_field_id is not available (options page or other) |
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 | |
/** | |
* Registering meta boxes | |
* | |
* Based on these metaboxes and a global metabox variable, but can be modified to suit others: | |
* @link http://www.deluxeblogtips.com/meta-box/docs/define-meta-boxes | |
*/ | |
// Add new metaboxes - hook into after the metaboxes have been defined, but before they have been registered | |
add_action( 'admin_init', 'jdn_modify_metabox_fields', 1 ); |
OlderNewer