Ethos carousel not showing after update

Hi, I just updated the X theme and the Ethos carousel is not showing on the home page and on index pages as well. There’s a white space instead. I disabled all plugins and the problem was still there. Can you look into it?

Site: travelstudies.org
Wordpress: 4.9.7
X theme: 6.2.5 with child theme
Cornerstone: 3.2.5

Thank you.

Hi there,

Thanks for writing in! I checked your site and I see an error related to post carousel in browser’s console which is preventing it to work. That usually happens due to a third party plugin conflict but since you’ve already tested that, please check for the following first:

  1. Ensure everything is up to date according to our version compatibility list at https://theme.co/apex/forum/t/troubleshooting-version-compatibility/195. Please follow the best practices when updating your theme and plugins. See https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62 for more details.

  2. Clear all caches including browser cache then deactivate your caching plugins and other optimization plugins.

  3. If you’re using a CDN, please clear the CDN’s cache and disable optimization services.

  4. As you’ve already tested the plugins but please deactivate all plugins except Cornerstone.

  5. Remove custom JavaScript and deactivate your child theme and switch to parent theme (take a complete backup first).

Let us know how this goes!

Hi, Thanks for your reply. The problem appears to be something in the child theme code. When I switched to the parent theme, the carousel worked fine. Here’s the modified child theme for the carousel php. Do you see anything here that could be causing the problem?

application/x-httpd-php _post-carousel.php
PHP script text

<?php // ============================================================================= // VIEWS/ETHOS/_POST-CAROUSEL.PHP // ----------------------------------------------------------------------------- // Outputs the post carousel that appears at the top of the masthead. // ============================================================================= GLOBAL $post_carousel_entry_id; $post_carousel_entry_id = get_the_ID(); $is_enabled = x_get_option( 'x_ethos_post_carousel_enable', '' ) == '1'; $count = x_get_option( 'x_ethos_post_carousel_count' ); $display = x_get_option( 'x_ethos_post_carousel_display' ); switch ( $display ) { case 'most-commented' : $args = array( 'post_type' => 'post', 'posts_per_page' => $count, 'orderby' => 'comment_count', 'order' => 'DESC' ); break; case 'random' : $args = array( 'post_type' => 'post', 'posts_per_page' => $count, 'orderby' => 'rand' ); break; case 'featured' : $args = array( 'post_type' => 'post', 'posts_per_page' => $count, 'orderby' => 'date', 'meta_key' => '_x_ethos_post_carousel_display', 'meta_value' => 'on' ); break; } if(is_archive()){ $categories = get_the_category(); if(isset($categories[0]->cat_ID)) { $category_id = $categories[0]->cat_ID; $args = array('post_type' => 'post', 'posts_per_page' => $count, 'category__in' => array( $category_id )); } } else { $args = array('post_type' => 'post', 'posts_per_page' => $count, 'category__in' => array( 138, 157, 96, 101, 3, 29, 173, 191 )); } ?> <?php if ( $is_enabled ) : ?>
<?php $wp_query = new WP_Query( $args ); ?>

<?php if ( $wp_query->have_posts() ) : ?>
  <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>

    <li class="x-post-carousel-item">
      <?php x_ethos_entry_cover( 'post-carousel' ); ?>
    </li>

  <?php endwhile; ?>
<?php endif; ?>

<?php wp_reset_query(); ?>

<script>

jQuery(document).ready(function() {
  jQuery('.x-post-carousel').slick({
    speed          : 500,
    slide          : 'li',
    slidesToShow   : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_extra_large', '5' ); ?>,
    slidesToScroll : 1,
    responsive     : [
      { breakpoint : 1500, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_large', '4' ); ?> } },
      { breakpoint : 1200, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_medium', '3' ); ?> } },
      { breakpoint : 979,  settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_small', '2' ); ?> } },
      { breakpoint : 550,  settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_extra_small', '1' ); ?> } }
    ]
  });
});

</script>
<?php endif; ?>

Hi There,

Upon checking your website, I see some JS errors.

Please try testing a plugin conflict. You can do this by deactivating all third-party plugins, and see if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

If it doesn’t help, would you mind providing us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:

  • Link login to your site
  • WordPress Admin username / password
  • FTP credentials

Thanks.

Hello There,

Thanks for providing the ftp details. I have inspected your child theme and it turns out that you are using the legacy child theme. To update it, please move your _post-carousel.php to /wp-content/themes/x-child-ethos/framework/legacy/cranium/headers/views. And make sure that the php content is similar to this code:

<?php

// =============================================================================
// VIEWS/ETHOS/_POST-CAROUSEL.PHP
// -----------------------------------------------------------------------------
// Outputs the post carousel that appears at the top of the masthead.
// =============================================================================

GLOBAL $post_carousel_entry_id;

$post_carousel_entry_id = get_the_ID();

$is_enabled = x_get_option( 'x_ethos_post_carousel_enable' ) == '1';
$count      = x_get_option( 'x_ethos_post_carousel_count' );
$display    = x_get_option( 'x_ethos_post_carousel_display' );

switch ( $display ) {
  case 'most-commented' :
    $args = array(
      'post_type'      => 'post',
      'posts_per_page' => $count,
      'orderby'        => 'comment_count',
      'order'          => 'DESC'
    );
    break;
  case 'random' :
    $args = array(
      'post_type'      => 'post',
      'posts_per_page' => $count,
      'orderby'        => 'rand'
    );
    break;
  case 'featured' :
    $args = array(
      'post_type'      => 'post',
      'posts_per_page' => $count,
      'orderby'        => 'date',
      'meta_key'       => '_x_ethos_post_carousel_display',
      'meta_value'     => 'on'
    );
    break;
}

?>

<?php if ( $is_enabled ) : ?>

  <?php $wp_query = new WP_Query( $args ); ?>

  <?php if ( $wp_query->post_count > 0 ) : ?>

    <ul class="x-post-carousel unstyled">

      <?php if ( $wp_query->have_posts() ) : ?>
        <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>

          <li class="x-post-carousel-item">
            <?php x_ethos_entry_cover( 'post-carousel' ); ?>
          </li>

        <?php endwhile; ?>
      <?php endif; ?>

      <script>

      jQuery(document).ready(function() {
        jQuery('.x-post-carousel').xSlick({
          speed          : 500,
          slide          : 'li',
          slidesToShow   : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_extra_large' ); ?>,
          slidesToScroll : 1,
          rtl            : <?php echo json_encode( is_rtl() ); ?>,
          responsive     : [
            { breakpoint : 1500, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_large' ); ?> } },
            { breakpoint : 1200, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_medium' ); ?> } },
            { breakpoint : 979,  settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_small' ); ?> } },
            { breakpoint : 550,  settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_extra_small' ); ?> } }
          ]
        });
      });

      </script>

    </ul>

  <?php endif; ?>

  <?php wp_reset_query(); ?>

<?php endif; ?>

Please let us know how it goes.

That solved the problem! Thanks very much.

You are welcome :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.