Updated to 6.25 - Post Carousel with Custom Posts Disappeared

Good morning,

I updated to 6.25 this morning and for some reason my custom post carousel disappeared. I went through theme options and didn’t see a place for it anymore, but the custom posts in my post carousel is vital to the way my website operates. Post Carousel is listed as ON, and it’s set to featured, however I no longer see a place to select the featured posts. Please let me know how to fix this and quickly because currently I have a white bar at the top of my website.

My website is: www.garrettandwalker.com

Thank you for your help.

Hi there,

Kindly try to clear your site’s cache especially in the Autoptimize plugin then refresh your browser.

Let us know how it goes.

Thank you Jade. I saw that as an option in another post on this forum, tried it, and it didn’t fix it. Any other suggestions?

Thank you for your help.

This matter is kind of pressing in nature, if anyone could please help, I would sincerely appreciate it. I’m willing to give access to my website to resolve. Thank you for your help.

Hello @JK2013,

Thanks for updating the thread.

Please edit the post and make sure that you have selected Featured Post under Ethos Post Settings.

In case problem is still there, kindly get back to us with the result of the steps above and URL/User/Pass of your WordPress dashboard using the Secure Note functionality of the post to follow up the case.

Thank you.

Thank you Prasant. I have checked and those boxes have been checked. I’ll include the secure note with my reply. Thank you again for your help.

The credentials you’ve posted works but you gave us limited access. We need admin level access.

Your posts in the carousel are actually there though. That means there’s no problem with the settings.

It’s just not showing up because there’s a script error most probably coming from file optimization. Would you mind clearing the cache again and deactivate Autoptimize? Please note that though file optimization is helpful, you will need to actually know the order of the scripts in your site to avoid breaking your site. If not, you’ll need a third party developer do an audit and optimize your site.

You also don’t need to optimize the resources of X and Cornerstone as their already minified. You should contact Autoptimize’s support to learn how to exclude all of the resources of a theme and plugins.

Thanks.

Thank you very much for your follow up and reply. I attempted your method and cleared the cache and then deactivated the Autoptimize Plugin, but it still didn’t work. I reset my browser and tried both chrome and edge to double check and the post carousel still isn’t visible. Thank you for your help. I will include admin level access with this post. Thank you Christian.

Hello There,

You have encountered the issue because of an outdated post carousel code. You have this code in _post-carousel.php file

<?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 ) : ?>

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

And the updated code is 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; ?>

I have updated your child theme’s _post-carousel.php file by replace slick with xSlick.

Please check your site now.

Thank you, this got the post carousel working again! However, it also caused a new error code at the top of my website which says:

Warning: Invalid argument supplied for foreach() in /home2/garreui4/public_html/wp-content/plugins/visual-form-builder/public/class-form-display.php on line 241

It seems like a bit of a game of whack-a-mole, but any help would be appreciated here as well. Thank you.

Hello There,

Thanks for updating in! Based from the warning, it is not coming from the theme. The warning says that a plugin name Visual Form Builder has an invalid argument. To get rid of this warning, the debug mode needs to be disabled. You can do this by opening wp-config.php and adding


define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

When you revisit the page, the warning should no longer be present.

Please let us know how it goes.

Thank you RueNel! But unfortunately, I copied and pasted: define(‘WP_DEBUG’, false); to wp-config.php, and the error still shows. I purged the cache as well just to see if that was the issue, but the error message is still there. Any other ideas? Thank you for your help.

Hello There,

When you temporarily disable Visual Form Builder, the PHP warning will disappear. You can check it in your homepage right now. I would strongly suggest that you contact the creator of this plugin and made him aware of this issue since this is a 3rd party plugin. I think he needs to know and must be able to resolve this issue getting rid of the PHP warning easily.

Thank you for your understanding.

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