Hello Support,
The Ethos top slider post is blank and it is not working I would like to know of a fix or is it an update problem? Thank you, TH.
Hello Support,
The Ethos top slider post is blank and it is not working I would like to know of a fix or is it an update problem? Thank you, TH.
Hello There,
Thanks for posting in! This looks like a caching issue. Since you have installed a caching plugin Comet Cache, please clear your plugin cache before testing your site. This can cause the changes to not take place on the front end. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately.
And if you made any modifications to the post slider in your child theme, please make sure that the file has the same content as this:
<?php
// =============================================================================
// VIEWS/ETHOS/_POST-SLIDER.PHP
// -----------------------------------------------------------------------------
// Outputs the post slider that appears at the top of the blog.
// =============================================================================
$is_blog = is_home();
$is_archive = is_category() || is_tag();
if ( $is_blog || $is_archive ) :
if ( $is_blog ) {
$info = array( 'blog', NULL, NULL, '_x_ethos_post_slider_blog_display' );
} elseif ( $is_archive ) {
$type = ( is_category() ) ? 'cat' : 'tag_id';
$info = array( 'archive', $type, get_queried_object_id(), '_x_ethos_post_slider_archives_display' );
}
$slider_enabled = x_get_option( 'x_ethos_post_slider_' . $info[0] . '_enable' ) == '1';
$count = x_get_option( 'x_ethos_post_slider_' . $info[0] . '_count' );
$display = x_get_option( 'x_ethos_post_slider_' . $info[0] . '_display' );
$blog_slider_is_enabled = $slider_enabled && $is_blog;
$archive_slider_is_enabled = $slider_enabled && $is_archive;
$is_enabled = $blog_slider_is_enabled || $archive_slider_is_enabled;
switch ( $display ) {
case 'most-commented' :
$args = array(
'post_type' => 'post',
'posts_per_page' => $count,
'orderby' => 'comment_count',
'order' => 'DESC',
$info[1] => $info[2]
);
break;
case 'random' :
$args = array(
'post_type' => 'post',
'posts_per_page' => $count,
'orderby' => 'rand',
$info[1] => $info[2]
);
break;
case 'featured' :
$args = array(
'post_type' => 'post',
'posts_per_page' => $count,
'orderby' => 'date',
'meta_key' => $info[3],
'meta_value' => 'on',
'ignore_sticky_posts' => true
);
break;
}
?>
<?php if ( $is_enabled ) : ?>
<?php $wp_query = new WP_Query( $args ); ?>
<?php if ( $wp_query->post_count > 0 ) : ?>
<div class="x-flexslider x-post-slider">
<ul class="x-slides">
<?php if ( $wp_query->have_posts() ) : ?>
<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<li class="x-slide">
<article <?php post_class( 'x-post-slider-entry' ); ?> style="<?php echo x_ethos_entry_cover_background_image_style(); ?>">
<a href="<?php the_permalink(); ?>">
<div class="cover">
<div class="middle">
<span class="featured-meta"><?php echo x_ethos_post_categories(); ?> / <?php echo get_the_date( 'F j, Y' ); ?></span>
<h2 class="h-featured"><span><?php x_the_alternate_title(); ?></span></h2>
<span class="featured-view"><?php _e( 'View Post', '__x__' ); ?></span>
</div>
</div>
</a>
</article>
</li>
<?php endwhile; ?>
<?php endif; ?>
</ul>
</div>
<script>
jQuery(window).load(function() {
jQuery('.x-post-slider').flexslider({
controlNav : false,
selector : '.x-slides > li',
prevText : '<i class="x-icon-chevron-left" data-x-icon-s=""></i>',
nextText : '<i class="x-icon-chevron-right" data-x-icon-s=""></i>',
animation : 'fade',
smoothHeight : true,
slideshow : true
});
});
</script>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php endif; ?>
<?php endif; ?>
Feel free to add your modifications if you have added any.
Ok, but no modifications was made comet cache was installed months ago, The website domain was renewed today that was the only thing done.
Hello There,
To assist you better with this issue, would you mind providing us the url of your site with login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation.
To do this, you can create a secure note with the following info:
– Link to your site
– WordPress Admin username / password
Thank you.
Hello There,
I have logged in and I found out that you are using a legacy child theme. To resolve your issue, please relocate the _post-carousel.php file from wp-contents/themes/x-child/framework/views/ethos/ to wp-contents/themes/x-child/framework/legacy/cranium/headers/views/ethos/.
And lastly, please make sure to update the contents of the file into 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; ?>
If you have modified the file, you may add your modifications in the code above.
RueNei, Something when wrong the site is down no front page.
Hey There,
I think there is a fatal error occurring in your site. Please enable the debug mode. You can do this by opening wp-config.php and adding:
define('WP_DEBUG', true);
/* That's all, stop editing! Happy blogging.
When you revisit the home page, you should have some error output describing the issue in more detail.
Please let us know how it goes.
I can not get to the front or the back end of the site, I will need to contact the hosting company.
Hello There,
Please contact your hosting provider and ask for ftp details so that we can login and check the error.
Regards.
Looks like the site is back up while waiting for the Hosting Company if you want to take another look.
Hey There,
You have to do what I have suggested in my reply: https://theme.co/apex/forum/t/ethos-website-is-missing-the-post-slider/39650/5
Thanks.
This path to relocate you gave me does exist, I don’t see /legacy/cranium/headers/ do I need to create it? wp-contents/themes/x-child/framework/legacy/cranium/headers/views/ethos/.
I found the path and it has a _post-carousel.php file already should I leave it and do the relocate anyway with both files in that ethos folder? then update it?
Hey There,
wp-contents/themes/x-child/framework/legacy/cranium/headers/views/ethos/ does not exist in the child theme yet. You will have to create the folder paths first, relocate the file and update it later on.
Please let us know if this works out for you.
RueNei, We put the php file in the new path and put the updated codes in it but it didn’t work. If you need access to the hosting company to fix it let me know? thank you.
RueNei I got it to show up now but the code to make the slider move auto to the left is not working.
Hi,
Sorry I am not sure what you mean by “move auto to the left”.
Please note that carousels doesn’t animate or move, you will need to click on the arrow to move to the left or to the right.
Only the post slider has the animation feature.
Please check Ethos Demo site - http://demo.theme.co/ethos-1/
Thanks
Sorry the carousel did slide to the the left for over a year now, a code was given back in 2017. I need that code again if you can inquire for me Paul.
Hi there,
Please add the autoplay : true, parameter to the slick slider code in the _post-carousel.php file so kindly update:
<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>
to
<script>
jQuery(document).ready(function() {
jQuery('.x-post-carousel').xSlick({
autoplay : true,
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>
Hope this helps.
Hi Jade I tried it but the auto-play didn’t work yet or the domain may need time to respond?