Load javascript only when specify.
-
Hi. Please help me load jquery plugin only when they should be calling.
Now I’m talking about prettyPhoto plugin.
I found this tips$pretty = ($pretty || ((is_single() || is_page()) && (strpos($post->post_content, 'rel="prettyPhoto"') > 1))); if ($pretty) { <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.prettyPhoto.js"></script> }
but this doesn’t work. This code delete plugin from all pages.
Please help me.
- The topic ‘Load javascript only when specify.’ is closed to new replies.