WordPress.org

Ready to get started?Download WordPress

Forums

podPress
[resolved] Can I hide Links / Player in Posts on Homepage only? (3 posts)

  1. funcshn@funcshn.com
    Member
    Posted 1 year ago #

    Can I hide Podpress Links / Player in Posts on my home page only? I would require to see links in Posts everywhere else throughout my site, just not on the home page that shows latest Posts.

    http://wordpress.org/extend/plugins/podpress/

  2. ntm
    Member
    Plugin Author

    Posted 1 year ago #

    There is no setting for this. But you could use a little add-on plugin to achieve your goal.
    Copy the following code into a .txt file, rename the file maybe to podpress_filter_for_index.php (important is that the file has the file name extension .php) and upload it to the /wp-content/plugins folder of your blog. (It is a good idea to create a sub folder and to put the into the sub folder.)

    <?php
    /*
    Plugin Name: hide podPress elements (index)
    Plugin URI:
    Description: This plugin hides the podPress elements on the index page (main blog page).
    Author: ntm
    Version: 1.0
    Author URI: http://profiles.wordpress.org/ntm/
    */
    
    add_action('wp_head', 'podpress_hide_elements_on_the_index_page', 8);
    function podpress_hide_elements_on_the_index_page() {
    	// if it is the home page (index.php) then
    	if ( TRUE === is_home() ) {
    		// prevent podPress from loading and printing Javascripts and CSS to the header section
    		remove_action('wp_print_scripts', 'podpress_print_frontend_js');
    		remove_action('wp_print_styles', 'podpress_print_frontend_css');
    
    		// add a filter to a certain filter hook of the plugin podPress. This filter will erase all podPress content which would be added to a post.
    		add_filter('podpress_post_content', 'podpress_do_not_print_content');
    	}
    }
    
    function podpress_do_not_print_content($podpress_content) {
    	// receives the code of the podPress content of a post and returns simply nothing.
    	return '';
    }
    ?>

    Once the file is uploaded you will see this plugin in the list on the plugins page of your blog. Activate it. It will start working immediately.

    Tim

  3. funcshn@funcshn.com
    Member
    Posted 1 year ago #

    Cool!

    Thanks, Leigh

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic