WordPress.org

Support

Support » Plugins and Hacks » podPress » [Plugin: podPress] CSS and JS on every page

[Plugin: podPress] CSS and JS on every page

  • Thanks for the really quick turnaround on the PHP warning, and thanks for developing this great plugin.

    I’ve noticed that this plugin however loads .js and .css files on every single WordPress page, even if there is no podcast on the page.

    In addition, I show podpress/players/1pixelout/1pixelout_audio-player.js loading twice on my site.

    http://blindscribblings.com

    Is it possible to only load them on pages where there is a podcast?

    I’m not a PHP/JS developer, but I came across a post that might be useful that discusses how to only load your javascript on the WordPress page that needs it.

    http://aquoid.com/news/2011/02/suffusion-version-3-7-8/ – Scroll down to “Things that are not issues”

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author ntm

    @ntm

    I’ve noticed that this plugin however loads .js and .css files on every single WordPress page, even if there is no podcast on the page.

    Yes, you are right this should be optimized. I will read the article which you have mentioned.

    to the duplicate JS section:
    This is most likely related to the way your theme loads the scripts. Does one of the files which create the header contain a call of the function wp_print_scripts()?

    That was in the past the problem see:
    http://wordpress.org/support/topic/plugin-podpress-duplice-javascript-in-head
    http://wordpress.org/support/topic/podpress-code-twice-in-sourcecode
    http://wordpress.org/support/topic/podpress-broke-audio-player

    Plugin Author ntm

    @ntm

    It is also possible that a different plugin interferes somehow. Which plugins are active in your blog?

    Plugin Author ntm

    @ntm

    I have tried the Suffusion Theme. But that alone is not producing the duplicate sections.

    Plugin Author ntm

    @ntm

    It would be great if you could try whether or not a further plugin is somehow interfering this way. Deactivate the plugins one-by-one clear the cache, reload the page and look into the source code. If we know which plugin might be responsible then I might be able to find out what the problem is and eventually fix podPress or make other suggestions.
    I would appreciate your help with this. It would probably be very difficult to rebuild the situation in my test blog because of the vast number of settings for the W3 Total Cache plugin alone.

    But maybe it the theme as mentioned above.

    Regards,
    Tim

    Will do. I’ll experiment with disabling different plugins.

    I’m running WP 3.4 from SVN if it makes a difference.

    Plugin Author ntm

    @ntm

    Thanks for doing the tests!

    It is probably not an issue with WP 3.4. I installed WP 3.4 bleeding edge, Suffusion (the base theme) and podPress and have no duplicate JS sections.

    Plugin Author ntm

    @ntm

    About the link you have posted above:
    I have read what the authors of the Suffusion Theme have written about adding scripts and styles in WP. What they have written is fine and the standard way for adding script and style files. I’m familliar with these methods and podPress adds scripts and styles this way.

    Is it possible to only load them on pages where there is a podcast?

    It would be possible but I could not find in the linked article new information about a really good way to do this.
    To determine whether a page contains posts with podPress attachments, it would require at least one further db query. (at least I can’t think of a different way) The question is, what is faster? One or more db queries or loading the JS file.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: podPress] CSS and JS on every page’ is closed to new replies.
Skip to toolbar