Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8487777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:20:50+00:00 2026-06-10T21:20:50+00:00

I have two pieces of code that I need to use together. I am

  • 0

I have two pieces of code that I need to use together. I am trying to ask this question again in a more clear and concise way because reading my last question – confused even me.

I have found what needs to be done, I just don’t think I am doing it right.

What I need to do is to prevent an infinite loop from playing in a JS Slide. Yes, the slide is in WP so there is the whole swapping $ for jQuery to consider.

This is where the theme author says to revise the code:

    <?php if (is_page_template('page-template-home-jquery.php') || is_page_template('page-template-home-jquery-sidebar.php')) { ?>
    <?php echo '<script type="text/javascript">
    // Homepage slider setup. Issued in the footer to accept user-set variables.
    jQuery(document).ready(function(){
jQuery(\'#slides\').slides({
      preload: false,
      //preloadImage: \'http://files.truethemes.net/themes/sterling-wp/ajax-loader.gif\',
      autoHeight: true,
      effect: \''.$truethemes_jslide_effect.'\',
      slideSpeed: '.$truethemes_jslide_speed.',
      play: '.$truethemes_jslide_delay.',
      randomize: '.$truethemes_jslide_randomize.',
      hoverPause: '.$truethemes_jslide_pause_hover.',
      pause: '.$truethemes_jslide_delay.',

  });
    });
    </script>';?>
    <?php } ?> 

This is what is “supposed” to accomplish what I need and I have found it working on other sites:

    $(function(){
    var total = $("#slides img").length - 2; // Subtract Two arrows
    $('#slides').slides({
    animationComplete: function(current) {
    if (current >= total) {
    clearInterval($('#slides').data('interval'));
    }
    },
    });

Unfortunately when I try it on my site, it breaks the autoplay and removes the pagination.

This is what I managed to put together in an effort to get it to work:

    jQuery(document).ready(function(){
    var total = $("#slides img").length - 2;
    jQuery('#slides').slides({
    animationComplete: function(current) {
    if (current >= total) {
    clearInterval($('#slides').data('interval'));
    }
    },
    preload: false,
    //preloadImage: 'http://files.truethemes.net/themes/sterling-wp/ajax-loader.gif',
    autoHeight: true,
    effect: 'fade',
    slideSpeed: 10000,
    play: 7000,
    randomize: false,
    hoverPause: true,
    pause: 7000,
    });
    }); 

You may notice that my effort does not include the “pre-set” settings being pulled though in the original code included in my theme which is riddled in php (to me).

I know I am not doing this properly and may not be on the right track. I did get a response from the “author” whose directions were to put it in the footer and upload. Don’t know about you, but I think he or she should have assumed that I would have tried that before contacting them. So, needless to say… that was a bust.

Here is a link to a website that is using the code I am trying to incorporate:

http://alliancebrokeragecorp.com/

Any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:20:51+00:00Added an answer on June 10, 2026 at 9:20 pm

    Just in case any one else has trouble trying to do this with in a WP theme, I thought I would post the solution here:

        <?php if (is_page_template('page-template-home-jquery.php') || is_page_template('page-template-home-jquery-sidebar.php')) { ?>
        <?php echo '<script type="text/javascript">
        // Homepage slider setup. Issued in the footer to accept user-set variables.
        jQuery(document).ready(function(){
        var total = jQuery(".slides_container .home-slider-post").length;
        jQuery(\'#slides\').slides({
        animationComplete: function(current) {
          if (current >= total) {
          clearInterval(jQuery("#slides").data("interval"));
         }
       },
          preload: false,
          autoHeight: true,
          effect: \''.$truethemes_jslide_effect.'\',
          slideSpeed: '.$truethemes_jslide_speed.',
          play: '.$truethemes_jslide_delay.',
          randomize: '.$truethemes_jslide_randomize.',
          //hoverPause: '.$truethemes_jslide_pause_hover.',
         // pause: '.$truethemes_jslide_delay.',
      });
       });
     </script>';?>
     <?php } ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two pieces of jquery code, they work perfectly separate, but together -
I have these two pieces of code that each return a relation inside the
I have two pieces of C++ code running on 2 different cores. Both of
I have written two pieces of code which I intended to have identical outputs,
I have two OptionMenu widgets in the simple pieces of code shown below: variable
I have created Generic Repository and I have two entities that i need to
I have two question: 1) I need some expert view in terms of witting
I have two essentially separate applications for configuring two pieces of hardware sold by
I have divided a rectangular shaped image into two pieces as as shown below
I'm looking for a ready-to-use piece of code that would be able to read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.