<?php
/*
Plugin Name: Expound Remove Related Posts
Plugin URI: n/a
Description: removes the 'related posts' section from single posts without the need of a child theme
Version: 1.0
Author: alchymyth
Author URI: http://transformationpowertools.com
License: GPL2
*/
add_action( 'setup_theme', 'modify_pluggable_expound_theme_functions' );
function modify_pluggable_expound_theme_functions() {
if( wp_get_theme() == 'Expound' && get_stylesheet_directory() == get_template_directory() ) :
//check for the right theme and that no child theme is used
function expound_get_related_posts() {
$args = array(
'ignore_sticky_posts' => true,
'category_name' => 'expound-removed-related-posts'
//impossible category name to generate an empty query
);
return new WP_Query( $args ); //return no related posts
}
endif;
}
?>