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
//* Recent Posts Widget Filtered by Current Category | |
add_filter( 'widget_posts_args', 'my_widget_posts_args'); | |
function my_widget_posts_args($args) { | |
if ( is_category() ) { // Adds the category parameter in the query if we display a category | |
$cat = get_queried_object(); | |
return array( | |
'posts_per_page' => 10, // The number of posts shown | |
'no_found_rows' => true, | |
'post_status' => 'publish', | |
'ignore_sticky_posts' => true, |
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 titles from pages only | |
add_action('get_header', 'child_remove_page_titles'); | |
function child_remove_page_titles() { | |
$pages=array(); | |
if (is_page($pages)) { | |
remove_action('genesis_entry_header', 'genesis_do_post_title'); | |
} | |
} |
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
// Set the number of posts per page | |
add_filter( 'pre_get_posts', 'be_archive_query' ); | |
// @link http://www.billerickson.net/customize-the-wordpress-query/ | |
function be_archive_query( $query ) { | |
if( $query->is_main_query() && $query->is_archive() ) { | |
$query->set( 'posts_per_page', 12 ); | |
} | |
} | |
// OR |
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 | |
//* Replace the standard loop with our custom loop | |
//* props to David Wang, he is the man! | |
// @author David Wang | |
// @link http://genesissnippets.com/genesis-custom-loop/ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'child_do_custom_loop' ); | |
function child_do_custom_loop() { |
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
/** | |
* Change login logo | |
* Max image width should be 320px | |
* @link http://andrew.hedges.name/experiments/aspect_ratio/ | |
*/ | |
add_action('login_head', 'rgt_custom_dashboard_logo'); | |
function rgt_custom_dashboard_logo() { | |
echo '<style type="text/css"> | |
.login h1 a { | |
background-image:url('.get_stylesheet_directory_uri().'/images/logo.png) !important; |
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 the post content (requires HTML5 theme support) | |
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); |
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
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('book-thumbnail', array('class' => 'book-thumbnail')); ?></a> |
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
//* Register widget areas | |
genesis_register_sidebar( array( | |
'id' => 'after-post', | |
'name' => __( 'After Post', 'theme-name' ), | |
'description' => __( 'This is the widget that appears after a single posts.', 'theme-name' ), | |
) ); |
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 | |
if ( is_active_sidebar( 'after-entry' ) ) { | |
genesis_widget_area( 'after-entry', array( | |
'before' => '<div class="after-entry">', | |
'after' => '</div>', | |
) ); | |
} |
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 | |
// Show featured image on single posts | |
add_action( 'genesis_before_entry_content', 'child_featured_post_image', 8 ); | |
function child_featured_post_image() { | |
if ( ! is_singular( 'post' ) ) return; | |
the_post_thumbnail('post-image'); | |
} |
OlderNewer