Last active
September 1, 2015 00:39
-
-
Save srikat/7ca2840c2409662e793a to your computer and use it in GitHub Desktop.
How to show one post on Blog and only titles on Category archives in Genesis.
This file contains hidden or 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_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 ); | |
| remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); | |
| remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); | |
| remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
| remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); | |
| remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); | |
| remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 ); | |
| remove_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 ); | |
| remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); | |
| remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); | |
| remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
| remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 ); | |
| remove_action( 'genesis_after_entry', 'genesis_get_comments_template' ); | |
| add_action( 'loop_start', 'sk_opening_articles_tag' ); | |
| function sk_opening_articles_tag() { | |
| echo '<div class="articles">'; | |
| } | |
| add_action( 'loop_end', 'sk_closing_articles_tag' ); | |
| function sk_closing_articles_tag() { | |
| echo '</div>'; | |
| } | |
| genesis(); |
This file contains hidden or 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
| add_action( 'pre_get_posts', 'sk_change_blog_posts_per_page' ); | |
| /** | |
| * Change Posts Per Page for Posts page | |
| * | |
| * @author Bill Erickson | |
| * @link http://www.billerickson.net/customize-the-wordpress-query/ | |
| * @param object $query data | |
| * | |
| */ | |
| function sk_change_blog_posts_per_page( $query ) { | |
| if( $query->is_main_query() && !is_admin() && is_home() ) { | |
| $query->set( 'posts_per_page', '1' ); | |
| } | |
| } |
This file contains hidden or 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
| .category .content .entry { | |
| margin-bottom: 0; | |
| padding-bottom: 0; | |
| padding-top: 20px; | |
| } | |
| .category .content .entry-title { | |
| font-size: 24px; | |
| } | |
| .category .articles { | |
| padding-top: 20px; | |
| padding-bottom: 40px; | |
| background-color: #fff; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment