Woo Theme (Delegate), Slider Broken, Pound Sign ( # ), Fixed

One of my clients has been using a theme by Woo called Delegate for a few years.  We recently encountered an issue where the home page slider stopped working, resulting in its contents just being empty and the navigation buttons only resulting in a # added to the end of the URL.

Here’s what I learned.

  1. in the theme’s folder, in /includes/theme-actions.php,  ~line 84, there is a section of code that starts with an html comment <!– Slider Setup –>… This is followed by a script that is set with PHP to only load if the current page “is_home” like this<script type=”text/javascript”>
    <?php if ( is_home() ) { ?> …Now, despite what this sounds like it means, is_home actually refers to your main posts page, so if you have a static front page in Settings>>Reading, this will return false.  Alter this conditional tag as follows to make the slider setup script run on your non-posts-page homepage.<script type=”text/javascript”>
    <?php if ( is_home() || is_front_page() ) { ?> …the “||” basically means “or” so now the conditional tag reads ‘if is main posts page or static front page’
  2. in the theme’s folder, in /includes/theme-js.php,  ~line 4, there is another instance of the conditional tag “is_home” that loads two Javascript files into the <head> of the html… This also needs to be changed if you’re using a static front page.if ( is_home() || is_front_page() ) {
    wp_enqueue_script( ‘jqueryEasing’, get_template_directory_uri() . ‘/includes/js/jquery.easing.min.js’, array( ‘jquery’ ) );
    wp_enqueue_script( ‘slides’, get_template_directory_uri() . ‘/includes/js/slides.min.jquery.js’, array( ‘jquery’ ) );
  3. Since we were using a custom page template that didn’t come with the theme (essentially a copy of index.php, but some modifications), we also needed to update the page template file, copying the new version of the slider’s activation from the new version of index.php<!– Featured Slider –>
    <?php if ( get_option( ‘woo_slider_disable’ ) != ‘true’ ) { get_template_part( ‘includes/slider’ ); } ?>
    <!– Featured Slider end –>

That’s basically it.  Keep in mind that updating the Woo Framework will likely overwrite these alterations, so back them up!!