Hey, I'm trying to add a little javascript to my posts but NOT my main page. If I stick it in the header it works fine but it shows up on my index as well, so I just want it in the singlepost.php but it doesn't work there, any help would be VERY appreciated. I am using wordpress and the javascript which I am trying to execute is a header script.I dont want it to run on my main page,but only on individual page,can you suggest me how to do that
Use this code in your header.php: <?php if(is_post()) : ?> enter javascript code here <?php endif; ?> If it's a post, it will show the javascript code. If you want it on your pages as well use <?php if(is_post() || is_page()) : ?> instead
Is it only possible to need to select your themes from a preselected number of themes. You cannot hack and edit these themes as per your liking.
Thanks for the reply,but what if I want that script to be displayed on certain posts and certain pages and how to exclude the home page from it?
<?php if(is_single(array(17, 19, 1, 11))) : ?> enter javascript code here <?php endif; ?> the no. in red are id of page add them and it will show on certain posts only
But I dont want to execute that Javascript in my header script as it will penalize my website in SEO results.What I want is to lock specific videos using that Javascript so that Search engines wont penalize my home page because of that Javascript