Post Carousel in X theme Ethos Showing Empty Space

Greetings,

A few months ago, I had posted a question relating to customizing the post carousel in Ethos to show the most recent posts. The solution I received worked, and I changed the .php file in the X theme folder. I have a child theme, and tried to put the new .php file there, but the file structure was not the same. I tried creating the proper folders in the child theme directory, but adding the .php file here didn’t do anything at the time. So, knowing that an update may change that customization, I left the new post carousel file in the X theme file where it was working.

Following the most recent update, I noticed that the post carousel setting had switched completely to show the most commented posts. When I tried to switch it back to ‘featured’ which I had edited to really show the most recent, there is just a big white space. I tried replacing the .php file again in the X theme folder, and again tried creating the folders in my child theme to mimic the x folder. Nothing works. I’m beginning to think my child theme never installed correctly from the beginning.

Any ideas? Should I be using a different .php file now? The website I’m working on is audacitymagazine.com

Thanks!

The working .php I was given in a previous post was:

<?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;



}
$args['orderby'] = 'DESC';
$args['orderby'] = 'date';
?>

<?php if ( $is_enabled ) : ?>

  <ul class="x-post-carousel unstyled">
    
    <?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' ); ?>,
    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; ?>
1 Like

Hi there,

Thanks for posting in. What path you added that file? It should be here \themes\x-child\framework\legacy\cranium\headers\views\ethos\_post-carousel.php. Though, I can check it for you, would you mind providing your admin and FTP login credentials in a secure note? I trace out the template file that being loaded through the child theme.

Thanks.

Hi! Just letting you know I sent you the information via private message. Thanks!

Hello There,

We do not check any private messages. It is best that you provide the details in a secure note. To know more how you can get support and add a secure note, please review this thread:

By the way, @Rad’s reply should fix your issue. Please be advised that before, the location of the file is just in:
\themes\x-child\framework\views\ethos\_post-carousel.php

In the latest release of the theme since X 5.x.x, it is now in:
\themes\x-child\framework\legacy\cranium\headers\views\ethos\_post-carousel.php

You will need to create the folder names because this paths does not exist in your child theme yet.

Hope this helps.

Hello,

Thanks for letting me know about the private messages. I thought that was the secure way to send my login details. I wasn’t sure how to send a secure message via the forum. I did not see a button or option at the time.

Anyway, I will write a new reply to @Rad With my information.

Unfortunately, his last reply did not fix my issue. I have made sure to create the file path in the child theme to match the file path in the main theme, and it did not work.

Thank you for your time!

Ok…not sure if I’m doing this right…

Hello There,

I have modified your post carousel file to resolve the issue and save time. What I did is just removed the meta key and meta value so that it will work when selecting “featured”.

Please check your site now.

Thank you so much! It works great now!

Glad to hear it!

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