Ethos Post Carousel Links Disappeared

Try the FTP credentials again please, thanks!

Hello There,

It turns out that you are using a legacy child theme. Please have it updated by relocating the _post-carousel.php from /wp-content/themes/x-child/framework/views/ethos to this new folder location /wp-content/themes/x-child/framework/legacy/cranium/headers/views/ethos/.

And the new contents of the post carousel file should be this:

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

Feel free to add your customizations and modifications if you have added in your old file.

Please let us know how it goes.

Hey There,

Thanks for responding. I updated to a new x child theme, but I’m not finding that folder to put the new code. Where is it???

Hi There,

Please create the folder and sub-folder if they’re existed:

Regards!

Thanks! I added the folder and updated the code as above, still no ethos featured posts showing up. Thoughts?

I did a little further testing, and I don’t think it’s the child theme. If I switch to the X theme the carousel works for most commented and random, but does not work for featured.

Something changed with how the features posts are handled since the last x update .

Hi @jfbball7,

Maybe you didn’t set the featured post yet? The old one is by manually adding the post ID. Example, edit your selected post and go to Ethos post settings section and turn on the option for featured.

Thanks!

Hey Rad,

That options works for posts, I have specific pages set to featured with the x_ethos_post_carousel_display on.

Can you please look into this? Specific page example:

Hi There,

The path of directory you created wasn’t correct: x-child/framework/cranium/headers/views/ethos.

It should be like this: x-child/framework/legacy/cranium/headers/views/ethos.

I’ve already corrected it, the post carousel is displaying fine now:

Cheers!

Hey Thai,

When it’s set to featured, this is what I see:

If I set it to random it appears again:

What do I need to do to get my featured posts back?!?

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.