Ethos blog archive layout: Title before featured image

Hello,

I’d like to know how can i change the layout of the ethos theme in order to make the title and meta (.entry-wrap header.entry-header ) appear right above the featured image and content.

Something like this: http://prntscr.com/m5l77r

Thanks in advance.

Hello Alejandro,

Thanks for writing in!

Because what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

Once you have your child theme active and ready, please follow these 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/CONTENT.PHP
// -----------------------------------------------------------------------------
// Standard post output for Ethos.
// =============================================================================

$is_index_featured_layout = get_post_meta( get_the_ID(), '_x_ethos_index_featured_post_layout',  true ) == 'on' && ! is_single();

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  
  <?php if ( $is_index_featured_layout ) : ?>
    <?php x_ethos_featured_index(); ?>
  <?php else : ?>
    
    <?php x_get_view( 'ethos', '_content', 'post-header' ); ?>

    <?php if ( has_post_thumbnail() ) : ?>
      <div class="entry-featured">
        <?php if ( ! is_single() ) : ?>
          <?php x_ethos_featured_index(); ?>
        <?php else : ?>
          <?php x_featured_image(); ?>
        <?php endif; ?>
      </div>
    <?php endif; ?>
    
    <div class="entry-wrap">
      <?php x_get_view( 'global', '_content' ); ?>
    </div>

  <?php endif; ?>
  
</article>

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

Of course, you will have to create the folder path since it does not exist in your child theme yet.

Reminder: This will only apply to standard post format. If you use other post formats, then you’ll edit the corresponding ethos file template too.

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

Thanks! that worked like a charm!

You’re welcome! :slight_smile:

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