Creating custom archives page

Hi, im trying to create a custom archives pages. Ive read the best practice stuff but am not sure i understand.

I read that its the same template as index.php but do i copy the index.php that is in the x theme folder or the _index.php that is in the folder of the stack im using? (Im using Ethos)

Do I recreate the folders in my child theme … Framework > Views > Ethos > then _index.php

or am i just putting copy .index php from X’s root and putting it at the root of my child theme? Bc I tried that and added some test

test

and nothing shows up.

THANK YOU!
Rena

Hey Rena,

Yes, you’ll need to recreate folders in your child theme exactly the same as the folder structure in the parent theme.

For example, if you’re going to override wp-index.php file of Ethos which is in the parent’s pro\framework\views\ethos, you’ll need to copy that file in the same folder in child theme pro-child\framework\views\ethos.

If you need to override the global _index.php which is located in pro\framework\views\global, you need to copy and edit it in the same folder in your child theme pro-child\framework\views\global.

Copying it to the root of your child theme won’t work.

If you’re not aware yet, you won’t need to modify or code a custom archive page in the future because there will be a Layout Builder in the future so you can build a custom archive page using a builder. For more details, please see our previous status report: https://theme.co/apex/forum/t/status-report-may-1-2019/57564

Hope that helps.

Oh thats cool. I’ll check that out once it’s available. I was able to duplicate the archives as you said but now I have another question.

I’m attaching the code and an image of the new archive page… (I added an advertisement on top which was the reason I needed to create this) But now in the meta info I need to put the author and date on separate lines. But I cannot figure out where in the code is coming from. What file would I edit to change the layout of this?
Thanks for your help.
Rena

<?php // ============================================================================= // VIEWS/ETHOS/WP-INDEX.PHP // ----------------------------------------------------------------------------- // Index page output for Ethos. // ============================================================================= $is_filterable_index = is_home() && x_get_option( 'x_ethos_filterable_index_enable' ) == '1'; get_header(); ?>
<?php if (function_exists ('adinserter')) echo adinserter (2); ?>
<?php x_get_view( 'ethos', '_post', 'slider' ); ?>

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

    <?php if ( $is_filterable_index ) : ?>
      <?php x_get_view( 'ethos', '_index' ); ?>
    <?php else : ?>
      <?php x_get_view( 'global', '_index' ); ?>
    <?php endif; ?>

  </div>

  <?php get_sidebar(); ?>

</div>
<?php get_footer(); ?>

Hi Rena,

The function that handles meta information is x_ethos_entry_meta() which is under the following file.
/x/framework/functions/frontend/ethos.php

You can copy that function into your child theme’s functions.php file and customize it according to your needs.

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Thanks!

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