WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Js and images inside page, how to get it to work? (1 post)

  1. astrada
    Member
    Posted 1 year ago #

    I got html website I need to transfer to wordpress. In one page I need to use this Metro Js 'plugin'. I ve been struggling with this for days now, I tried out about dozen different approaches, and nothing works. This is what i have now:
    in header.php
    <?php wp_register_script('MetroJs.lt', get_template_directory_uri().'/js/MetroJs.lt.js');
    wp_enqueue_script('MetroJs.lt');?>

    <?php wp_register_script('jquery-1.7.1.min', get_template_directory_uri().'/js/libs/jquery-1.7.1.min.js');
    wp_enqueue_script('jquery-1.7.1.min');?>
    <?php wp_register_style('metrojs', get_template_directory_uri().'/metrojs.css');
    wp_enqueue_style('metrojs');?>

    and trough edit page interface afeter code with my images that are placed inside div and li I added this

    <script type="text/javascript" src="mypath/js/MetroJs.lt.js"></script>
    <script type="text/javascript" src="mypath/js/libs/jquery-1.7.1.min.js"></script>
    <script type="text/javascript">
    <!--
    $(".flip-list").liveTile();
    //--></script>

    I can see(view source in browser) in header links to scripts and when i click them it takes me to script file, so I guess first part of my code is ok. This second part of code is tested and it is working in HTML web site. What am I doing wrong here?

Topic Closed

This topic has been closed to new replies.

About this Topic