WordPress.org

Ready to get started?Download WordPress

Forums

podPress
Podpress queries only at single.php (2 posts)

  1. januzi_pl
    Member
    Posted 3 years ago #

    Is there a way to force podpress to run its queries only for single post that is displayed by the single.php template ?

  2. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    There is no option for it. But you could at a few lines of code to the functions.php of your theme.
    podPress has its own Filter Hooks. You can find a list of all hooks at the Other Notes page in the section "Filter Hooks of podPress".

    One of them is podpress_post_content which can be used to filter all the elements which podPress usually adds to the content of a post. (This hook is in all versions since podPress 8.8.8.)

    For example:

    function display_podpress_only_on_single_view($podpress_content) {
    	if ( TRUE == is_single() ) {
    		return $podpress_content;
    	} else {
    		return '';
    	}
    }
    add_filter('podpress_post_content', 'display_podpress_only_on_single_view');

    Add this to the function.php.

    Or you could put this code with Standard Plugin Information into a different .php file and store it in the plugins folder. This way you would have a little plugin which you could switch on and off.

    Regards,
    Tim

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags