Add Ethos Blog Slider to Pages

There doesn’t seem to be an option to add the ethos blog slider to pages… Can this be done somehow editing the php?

Hello There,

Thanks for writing in! Regretfully there is no option to add the posts slider in all your pages or selected page. You can only do that by modifying the page template. Assuming you have your child theme active and ready, please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?php

// =============================================================================
// VIEWS/ETHOS/WP-PAGE.PHP
// -----------------------------------------------------------------------------
// Single page output for Ethos.
// =============================================================================

?>

<?php get_header(); ?>

  <div class="x-container max width main">

    <?php x_get_view( 'ethos', '_post', 'slider' ); ?>

    
    <div class="offset cf">
      <div class="<?php x_main_content_class(); ?>" role="main">

        <?php while ( have_posts() ) : the_post(); ?>
          <?php x_get_view( 'ethos', 'content', 'page' ); ?>
          <?php x_get_view( 'global', '_comments-template' ); ?>
        <?php endwhile; ?>

      </div>

      <?php get_sidebar(); ?>

    </div>
  </div>

<?php get_footer(); ?>

3] Save the file named as wp-page.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/x-child/framework/views/ethos/

You may need to creator the folder names in your child theme.

We would loved to know if this has work for you. Thank you.

I uploaded the file to the correct directory and nothing happened.

I double checked that I’m actually using the child theme and all instructions.

Any idea?

EDIT: NVM i worked out what I needed to change

Ok it looks like the _post-slider.php has to be modified as well…

I got it mostly working by following this post: https://theme.co/apex/forums/topic/display-ethos-post-slider-on-a-custom-page/

However, the slider has no arrows on each side like it should so it is not obvious that it can scroll. How can I get the side arrows? Thanks

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

  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 || is_front_page();

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

  if (is_front_page()) {
    $args = array(
      'post_type'      => 'post',
      'posts_per_page' => $count,
      'orderby'        => 'rand',
      $info[1]         => $info[2]
    );
  }

  ?>

  <?php if ( $is_enabled ) : ?>

    
<?php endif; ?> <?php endif; ?>

Hello There,

Thanks for updating in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

Cheers.