Support Has Moved!

Please post all new questions on the new support system

Before posting a discussion topic, be sure to check out our Forum Rules and Support Policy.

Get design feedback and approval with our newest WordPress plugin, ProjectHuddle. Check it out →

Latest Struck Version is 1.06

Latest GridStack Version is 1.1

Latest Edition Version is 1.6

Latest District Version is 1.2.6

Latest ExtraNews Version is 1.4.9

Latest Aware Version is 1.4

Latest BigFormat Version is 1.4

Latest Bookcase Version is 1.54

Latest Ellipsis Version is 1.5

Fancy box

mtesfamichael's Avatar

mtesfamichael

13 Aug, 2015 02:15 PM

Hi,

I am using amcharts only in the homepage/front page and i have several js/css that needs to be included, however, i don't want to include that in the header as the code is only for the front page? anyways, i ended up including it in the header, and it stopped my rotating slider to work, and my fancybox lightbox stopped work. there is a js conflict for sure, what do you advise when i several custom js/css (note, i have javascript, not just css) to include.

thanks.

  1. 1 Posted by Eric Schmidt on 13 Aug, 2015 04:29 PM

    Eric Schmidt's Avatar

    Hi,

    Do you have a live URL I can see to figure out where the conflict is coming from? Are you using a child theme? If you have a child theme, you can enqueue CSS or JS for specific pages in your functions.php file like this...

    // Load conditional scripts
    function tw_conditional_scripts()
    {
        if (is_page('pagenamehere')) {
            wp_register_script('scriptname', get_template_directory_uri() . '/js/scriptname.js', array('jquery'), '1.0.0'); // Conditional script(s)
            wp_enqueue_script('scriptname'); // Enqueue it!
        }
    }
    
    add_action('wp_print_scripts', 'tw_conditional_scripts'); // Add Conditional Page Scripts
    

    Eric

  2. 2 Posted by mtesfamichael on 13 Aug, 2015 04:33 PM

    mtesfamichael's Avatar

    Yes I am using a child theme, so I can use what you suggested? do i copy the existing function and add this piece to it? thanks

  3. 3 Posted by mtesfamichael on 13 Aug, 2015 04:39 PM

    mtesfamichael's Avatar

    Okay got it working without having to use the script. thanks.

  4. Eric Schmidt closed this discussion on 14 Aug, 2015 01:52 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac