Hello @juhani,
Thanks for the updates. I have investigated your child theme and I can see that you have added custom features and functions in there. I also noticed that you are using the legacy theme files which we have moved its folder locations from wp-content/themes/x/framework/views/ethos/
to wp-content/themes/x/framework/legacy/cranium/headers/views/ethos/
.
To get tis sorted out, you need to check the locations of these files in the latest version and place those files in your child theme’s folder from wp-content/themes/x-child/framework/views/ethos/
to wp-content/themes/x-child/framework/legacy/cranium/headers/views/ethos/
.
Be advised that these file modifications will have to be checked by you or someone who made these modifications every after theme and plugin updates to make sure the modifications are still working or has to be updated with the new codes to make it work again.
Having said that, I have inspected one of the files and compared with the latest version of theme. I found out that in your child theme, the contents of your _post-slider.php
is this:
<?php
// =============================================================================
// VIEWS/ETHOS/_POST-SLIDER.PHP
// -----------------------------------------------------------------------------
// Outputs the post slider that appears at the top of the blog.
// =============================================================================
$is_blog = is_home() || is_front_page();
$is_archive = is_category() || is_tag();
if ( $is_blog || $is_archive ) :
if ( $is_blog || is_front_page()) {
$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'
);
break;
}
?>
<?php if ( $is_enabled || is_front_page() ) : ?>
<div class="x-flexslider x-post-slider">
<ul class="x-slides">
<?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-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">
<?php if (get_post_meta( get_the_ID(), 'custom-author', true )) { ?>
<span class="featured-meta custom-author custom-author-slider"><?php echo get_post_meta( get_the_ID(), 'custom-author', true ); ?></span>
<?php } else { ?>
<span class="featured-meta custom-date custom-date-slider"><?php echo get_post_meta( get_the_ID(), 'custom-date', true ); ?></span>
<?php } ?><br>
<?php if (get_post_meta( get_the_ID(), 'custom-location', true )) { ?>
<span class="featured-meta custom-location custom-location-slider"><?php echo get_post_meta( get_the_ID(), 'custom-location', true ); ?></span>
<?php } ?>
<h2 class="h-featured"><span><?php x_the_alternate_title(); ?></span></h2>
<span class="featured-view"><?php _e( 'Lue lisää', '__x__' ); ?></span>
</div>
</div>
</a>
</article>
</li>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
</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=""></i>',
nextText : '<i class="x-icon-chevron-right" data-x-icon=""></i>',
animation : 'fade',
smoothHeight : true,
slideshow : true
});
});
</script>
<?php endif; ?>
<?php endif; ?>
And in the latest version of the theme, the content codes is 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 ) : ?>
<?php wp_enqueue_script( 'cs-flexslider' ); ?>
<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>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php endif; ?>
<?php endif; ?>
Your _post-slider.php
file need to be in the correct, updated location and has to have the latest codes integrated to to your file to keep your modifications in tact and at the same time it still works with the latest version of the theme.
Be advised that custom coding and theme file modifications are beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.
Thank you for your understanding.