Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

expound customize

By: alchymyth on Nov 23rd, 2013  |  syntax: PHP  |  size: 0.85 KB  |  hits: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>