Hallo zusammen,
wie kann ich Podpress davon abhalten sich per se in wp_head reinzuschreiben? Ich würde gerne die Skripte gezielt auf der einen Seite einbinden auf der auch Podcasts verwendet werden und die anderen 500 Seiten nicht unnötig lahm legen.
Ich vermute der Schlüssel liegt in der podpress.php ab Zeile 327:
PHP
/* stuff that goes in the HTML header */
if ( TRUE == version_compare($wp_version, '2.7', '>=') ) {
if (FALSE === is_admin()) {
add_action('wp_print_scripts', 'podpress_print_frontend_js');
add_action('wp_print_styles', 'podpress_print_frontend_css');
}
add_action('wp_head', 'podPress_print_feed_links_to_header');
} else {
add_action('wp_head', 'podPress_wp_head');
}
add_action('wp_footer', 'podPress_wp_footer');
add_action('switch_theme', 'podPress_switch_theme');
Alles anzeigen
oder später ab Zeile 494:
PHP
function podpress_print_frontend_js() {
wp_register_script( 'podpress_frontend_script', PODPRESS_URL.'/js/podpress.js' );
wp_enqueue_script( 'podpress_frontend_script' );
// ntm: this way of loading a localized JS scripts is probably not very elegant but it works in WP version older than 2.3
// I know that since WP 2.3 the function wp_localize_script() exists and when it is decided to raise the minimum WP requirement of this plugin then this method will be used.
require_once(PODPRESS_DIR.'/podpress_js_i18n.php');
podpress_print_localized_frontend_js_vars();
podpress_print_js_vars();
}
// for WP 2.7+
function podpress_print_frontend_css() {
if (file_exists(get_template_directory().'/podpress.css')) {
wp_register_style( 'podpress_frontend_styles', get_template_directory_uri().'/podpress.css' );
} else {
wp_register_style( 'podpress_frontend_styles', PODPRESS_URL.'/podpress.css' );
}
wp_enqueue_style( 'podpress_frontend_styles' );
}
// for WP version < 2.7
function podPress_wp_head() {
// frontend header
echo '<script type="text/javascript" src="'.PODPRESS_URL.'/js/podpress.js"></script>'."\n";
// ntm: this way of loading a localized Js scripts is probably not very elegant but it works in WP version older than 2.3
// I know that since WP 2.3 the function wp_localize_script() exists and when it is decided to raise the minimum WP requirement of this plugin then this method will be used.
require_once(PODPRESS_DIR.'/podpress_js_i18n.php');
podpress_print_localized_frontend_js_vars();
podpress_print_js_vars();
if (file_exists(get_template_directory().'/podpress.css')) {
echo '<link rel="stylesheet" href="'.get_template_directory_uri().'/podpress.css" type="text/css" />'."\n";
} else {
echo '<link rel="stylesheet" href="'.PODPRESS_URL.'/podpress.css" type="text/css" />'."\n";
}
podPress_print_feed_links_to_header();
}
Alles anzeigen
Wenn dann kein Podcast-Feed mehr angezeigt wird ist das völlig egal. Nur die Podcasts sollten auf der einen Seite abspielbar bleiben.
Für sachdienliche Hinweise wäre ich sehr dankbar!