WordPress.org

Ready to get started?Download WordPress

Forums

podPress
Hiding player on home page with excerpt used (3 posts)

  1. John Robertson
    Member
    Posted 3 years ago #

    Hey guys, I have an issue. Basically my home page posts show a limited number of characters per post via the the_excerpt() function, so I don't have to manually set any Read More tags. However it seems podpress is not seeing that and it still shows the player on the home page. For me, that is messing up my theme because of the nature of the design (http://www.motorthusiast.com) ... as you can see in the Top Gear post, the player is there when I dont want it to be there.

    I checked all the settings but somehow I think it does not take into considering the excerpt function. Any ideas?

  2. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    You may try the current Development Version which handles excerpts differently. If you do that then control your podPress settings after the upgrade.

    A more temporary solution might be to adjust your CSS a little bit. It is possible to hide the podPress content with

    .podPress_content {
    	display:none;
    }

    Put this in a file called e.g. podpress_excerpt_temp.css.
    Further it is necessary to make sure this style is only for the home, category and archive view. To do that you could use a little filter plugin:

    <?php
    /*
    Plugin Name: podPress temporary excerpt filter
    Plugin URI:
    Description: filters the podPress elements on the home, category and archive pages
    Author: ntm
    Version: 1.0
    Author URI:
    Min WP Version: 2.6
    License: GNU General Public License
    */
    
    add_filter('template_redirect', 'add_css_to_excerpt_pages');
    function add_css_to_excerpt_pages() {
    	if ( is_home() OR is_archive() OR is_category() ) {
    		wp_register_style('podpress_style_for_excerpt_pages', plugins_url('/podpress_excerpt_temp.css', (__FILE__)));
    		wp_enqueue_style('podpress_style_for_excerpt_pages');
    	}
    }
    ?>

    Call that file e.g. podpress_temp_excerpt_filter.php and place both file in the same directory inside the plugins directory e.g. /wp-content/plugins/podpress_filters/ and active this plugin. (Minimum requirement is WP 2.6)
    Note that this filter is only limited to these special pages but not recognizes whether you have activated the option to display excerpts instead of full posts.

    Regards,
    Tim

  3. John Robertson
    Member
    Posted 3 years ago #

    Alright thanks man! Nice plugin of course, Ill send in a donation since I do plan to jump fully onto the podcasting scene later on.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags