Ethos Post Carousel Links Disappeared

Hello There,

How did you set your posts as featured post? Please follow the instruction given by Rad. You have to edit the posts so that you can set it as featured and to display in the carousel.

To know more about Ethos Post Settings, please check this out: https://theme.co/apex/forum/t/meta-options-posts/143

Hope this helps.

That doesn’t help at all, I am trying to set a PAGE, not a POST.

I set it as described above. I have been running this over 1 year without problems, but it hasn’t worked since the recent x theme updates.

Can you guys please look for a solution to this issue?

Hello There,

There were some changes in the code of the carousel and by default, the carousel will only display posts. If you have made some customizations to display pages, you might need to add back your customizations again. Would you mind providing as the list of pages you have set as feature and wanted to display in the carousel?

Thanks.

I appreciate you looking at it, all of the customizations I did (which are a lot) where directed by the great X-support team. They are located in the CSS editor.

Thanks!

Hello There,

I was able to resolved your issue and displayed the pages in the carousel. I modified your post carousel code and use this instead:

<?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'
    ); */

    // modified featured page supplied with IDs
    $args = array(
      'post_type'      => 'page',
      'post__in' 	   => array( 8600, 2976, 10101, 7 ),
      'posts_per_page' => $count,
      'orderby'        => 'date'
    );

    break;
}

?>

<?php if ( $is_enabled ) : ?>

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

  <?php if ( $wp_query->post_count > 0 ) : ?>
  	<div style="display: none;">testing</div>
    <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; ?>

Love and Relationship page doesn’t a featured image. Please insert one so that it will display in the carousel item.

Please check your site now.

Looks awesome, thanks for fixing. I added an image for the featured image.

Quick question, what is the best size for that image so that nothing is cut off?

Thanks again for figuring this out for me!!!

Hi,

The carousel image are set to Cover which means to Resize the background image to cover the entire container, even if it has to stretch the image or cut a little bit off one of the edges.

You have two options

  1. Set ii to Contain which means - Resize the background image to make sure the image is fully visible

Add this in Theme Options >CSS

.x-post-carousel.unstyled .entry-cover {
   background-size:contain;
}
  1. Resize your images to 600 x 450 and adjust if necessary until desired output is achieved.

Thanks

Awesome, Thank you so much! I appreciate all your help in fixing this!

You’re welcome! :slight_smile:

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