/ Published in: PHP
create two custom fields: one called custom_css and one called custom_js.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $id = $wp_query->post->ID; $css_docs = get_post_meta($id, 'custom_css', false); $js_docs = get_post_meta($id, 'custom_javascript', false); { echo '<!--Custom css for '.get_the_title().'.-->'."\n"; foreach ($css_docs as $css) { echo '<link rel="stylesheet" href="'.$css.'" type="text/css" media="screen" />'."\n"; } } { echo '<!--Custom javascript for '.get_the_title().'.-->'."\n"; foreach ($js_docs as $js) { echo '<script src="'.$js.'" type="text/javascript"></script>'."\n"; } } ?>