Advertisement
alchymyth

expound customize

Nov 23rd, 2013
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Expound Remove Related Posts
  4. Plugin URI: n/a
  5. Description: removes the 'related posts' section from single posts without the need of a child theme
  6. Version: 1.0
  7. Author: alchymyth
  8. Author URI: http://transformationpowertools.com
  9. License: GPL2
  10. */
  11.  
  12. add_action( 'setup_theme', 'modify_pluggable_expound_theme_functions' );
  13.  
  14. function modify_pluggable_expound_theme_functions() {
  15.  
  16.     if( wp_get_theme() == 'Expound' && get_stylesheet_directory() == get_template_directory() ) :
  17.         //check for the right theme and that no child theme is used
  18.         function expound_get_related_posts() {
  19.             $args = array(
  20.             'ignore_sticky_posts' => true,
  21.             'category_name' => 'expound-removed-related-posts'
  22.             //impossible category name to generate an empty query
  23.             );
  24.         return new WP_Query( $args ); //return no related posts
  25.         }
  26.     endif;
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement