Advertisement
srikat

page_latestfullpost.php

Mar 29th, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.52 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * @author  Sridhar Katakam, https://sridharkatakam.com/
  5.  */
  6.  
  7. /*
  8.     Template Name: Latest Full Post
  9. */
  10.  
  11. // Force full width content
  12. add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
  13.  
  14. // Remove default Genesis Loop
  15. remove_action( 'genesis_loop', 'genesis_do_loop' );
  16.  
  17. // Add custom Genesis Loop
  18. add_action( 'genesis_loop', 'sk_do_loop' );
  19. /**
  20.  * Outputs a custom loop
  21.  *
  22.  * @global mixed $paged current page number if paginated
  23.  * @return void
  24.  */
  25. function sk_do_loop() {
  26.  
  27.     // accepts any wp_query args
  28.     $args = (array(
  29.         'posts_per_page' => 1
  30.     ));
  31.  
  32.     genesis_custom_loop( $args );
  33. }
  34.  
  35. // Remove Archive Pagination
  36. remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
  37.  
  38. // Force Full Content
  39.  
  40. add_filter( 'genesis_pre_get_option_content_archive', 'sk_do_full_content' );
  41. // Set the content archives to full
  42. function sk_do_full_content() {
  43.     return 'full';
  44. }
  45.  
  46. add_filter( 'genesis_pre_get_option_content_archive_limit', 'sk_no_content_limit' );
  47. // Make sure the content limit isn't set
  48. function sk_no_content_limit() {
  49.     return '0';
  50. }
  51.  
  52. // Remove the post image
  53. remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
  54.  
  55. // Display Genesis Simple Share Buttons
  56. add_action( 'genesis_entry_content', 'sk_gss_buttons', 7 );
  57. function sk_gss_buttons() {
  58.     if ( function_exists( 'genesis_share_icon_output' ) ) {
  59.         global $Genesis_Simple_Share;
  60.         genesis_share_icon_output( 'work', $Genesis_Simple_Share->icons );
  61.     }
  62. }
  63.  
  64. genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement