I have written this script in a scripts.js file. And I want execute the first half for only Home page and second half for custom post type page. How can I do this in wordpress ?
// This Chunk For Home Page [Part one]
jQuery("#front-page-slider").responsiveSlides({
maxwidth: 390,
"auto": true,
"pager": false,
"nav": false,
"pause": true,
speed: 800
});
// This Chunk is for For Only Custom Post Page [Part Two]
$("a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'pp_default',slideshow:3000, autoplay_slideshow: false});
var width = $(window).width();
As suggested in the comments, you can leverage the body class, e.g.:
this is my idea:
in the js:
in the header.php or footer.php:
*I dont know how to detect if is a custom post, search for it 😀