You should be using wp_enqueue_script
rather than putting script tags directly in template files:
function wpa61143_enqueue_scripts() {
if( is_page( 'home' ) ) :
wp_enqueue_script(
'jcarousel',
get_template_directory_uri() . '/scripts/jquery.jcarousel.min.js',
array( 'jquery' ),
null,
true,
);
elseif( is_single() ) :
// enqueue scripts for single
elseif( ! is_page_template('modelPages.php') ) :
// enqueue scripts for other
endif;
}
add_action( 'wp_enqueue_scripts', 'wpa61143_enqueue_scripts' );
Related Posts:
- How to add jQuery script to an individual page?
- Replace Dashes Before Title in Page List
- Using JavaScript and JQuery in Page
- Call the content of a page in AJAX in WordPress
- Can I include Javascript/jQuery in a page?
- Can’t get done anything with admin.php response
- Adding a Calculator to a WordPress Page
- JQuery Plugins in WordPress
- My AJAX requests take 30 seconds to complete
- static page with buton that opens collect email form
- Javascript will not run properly
- How to configure WordPress to handle 75,000 pages?
- What is the difference between $paged and $page?
- multi page password protection
- Create a “Dummy” parent page for a hierarchy in page listing?
- Custom SQL Query for WordPress page
- Change admin startpage to Pages-page?
- Password protected post or page – error message by wrong password?
- How restrict page for users logged? [closed]
- Only allow new subpages to be created
- Hide Visibility Option From WordPress Publish Metabox
- WordPress 4 and wp_editor() Not Showing Visual/Text tabs
- How to make nested page structure?
- Redirect to a page if ancestors is empty
- Get Order of Meta Box in a Page/Post
- Check to see if page exists problems
- Modify Page Title before output via wp_page_list
- List Child Pages of Parent Parent Page (Child pages from Grand Parent)
- Custom /page/2/ template (different from index.php)
- How to add meta boxes to Pages
- Front Page not showing on Pages
- WordPress pages with hierarchy
- Missing parent page attribute
- Hiding Page by Title from Editing
- Two Search pages, One search form
- Why doesnt ONE of my links in the footer work properly? [closed]
- Create subpage – filter parent pages list
- Use lots of pages, or categories/posts?
- How to have custom tinyMCE buttons break onto next line when too long
- Get all pages that are published
- Add a predefined page to site
- How do i change page template in bulk?
- Determine page content based on page parent
- Weird issue with is_pages() with array
- Missing ‘Page Attributes’ in page edit
- How to show the root webpage on all subpaths
- New user Registration data imported into Page
- Could be a namespace conflict (?) with login form and register form on the same page
- The concept of non-blog content
- Loading Multiple Comments Pages via Ajax?
- Change base URL of pages created by certain users
- Remove Content edit box from ALL pages (not posts)
- What is full URL for a post?
- How to list a page tree?
- How to create a page and display only the posts with a specific custom field value?
- Remove comment section from new page
- WordPress pages not working out correctly with HTML
- Change page name in admin list
- Manage content on multiple pages synchronysly?
- Print page content with formatting when doing custom SQL query
- wp_nav_menu: output featured image of each page listing
- Creating new page/tab in groups section not working! [closed]
- Prompting for review / reapproval of page content
- Limit the amount of main pages
- Add separate list of pages under Admin
- How to transfer a site to hosting?
- How to list pages from an author?
- Add the same content to multiple pages
- Cannot update page – with too many characters?
- Share a folder with files
- Front Page post mirroring revisions to other pages, constantly updating itself
- Is it possible to embedd this web app to my website [duplicate]
- Using external DB within wordpress
- Microsoft Security Essentials is blocking my WordPress website in IE11
- Author information on all pages
- Display inner pages like posts.[Like how post excerpt works]
- WordPress Pages “allow comments” meta option can’t be checked
- Loading internal page
- Firing page_publish where page is child page
- Add role and edit page capabilities
- Add text to the bottom of particular pages
- Access wordpress pages using a self signed shared ssl
- Google indexed pages for one page site
- WordPress, page 2 shows the same posts as page 1
- How to exclude page in pages module
- get id custom tables on current page
- Create a new page for each form selection
- pagination does not work with query_posts. Help! [duplicate]
- Subpage Conditional
- Multiple WordPress Pages
- Archive with specific keyword by category sorted by date
- How to pass the Querystring in pages?
- I have over 3000 child pages – but I need a different main page
- How to enable automatic search results in WordPress
- How to make a conditional statement that checks if the page is the child of a certain page?
- Edit the text location of a form
- How to customize the author page in wordpress?
- User profile in front-end
- custom css in one page
- Why is a page shown with ‘hidden’ next to the name in the list of pages if the page is set to public?