How do I fix my archive page?

My archive page is pretty much destroyed, and I fail to figure out where it is generated from in the first place.
Here’s the link: https://breakchill.com/2019/11/

The next/random/prev buttons are easily removed, but the problem is how broken the archive page is with me having no idea where it is even generated. Extensive searching around this forum, Google and more haven’t been helpful in any way.

Hi Daniel,

Thank you for reaching out to us. This could only be the cache issue, as I see the content of your site is being served by Endurance cache. Please clear all caches first and then turn off your endurance cache via Admin > Settings > General. Caching plugins are best to turn on only when you’ve finished building the site.

Let us know how this goes!

I was probably not clear enough, but thank you for your reply anyway.
My goal is to customise the archive page that comes with paginations into a custom page to display all the recent posts categorised by the selected month.
To be more precise, this is the page I’m talking about, that I wish to customise it to be appearing as one page:
https://breakchill.com/2019/11/

I had already done a custom archive page, and I linked it to the following page:

So, what I exactly want is to direct anyone selected the month of the year TO a custom page displaying the archived post inline and in one page instead of the current default pagination.

My main question is, where I could find the page that is responsible for customising this archive page: https://breakchill.com/2019/11/

Thank you for reading, I hope I can get supported asap since it’s urgent

And the cache level is already set to 0.

Hello Daniel,

All the archive pages is using the index.php file. WordPress dynamically generate the post items in the archive pages. Your archive page is messed up because you added this custom css to hide the post titles;

.entry-title {
    display: none;
}

And then somewhere in your child theme, you added this custom html;

<div class="post-pag-wrap">
  <div class="post-pag-container prev">
    .....
  </div>

  <div class="post-pag-container rand">
    <a href="https://breakchill.com/?redirect_to=random" style="outline: none;"><u style="color: #000000;">Random</u></a>
  </div>

  <div class="post-pag-container next"> 
    ....
  </div>  
</div>

This code should only be added in single posts and not to display in archive pages. If you can give us the exact code, please do so we can tweak it.

Best Regards.

I can’t make the forum format the code right. But here it is, this is the code I coded for adding the navigation buttons on the theme and they’re placed on content.php file: https://paste.ofcode.org/PG9XxbqUk6gtkV9nUwMeA6

And if archives are using index.php, can’t we make an archive.php that will overwrite it? I read something about that from an old blog post.

Hello Daniel,

is_single() condition must be added to the code so that the prev, random and next buttons will only be visible to the single post items:

<?php
  $categories = get_the_category();
  if ( ! empty( $categories ) && is_single() ) {
   foreach( $categories as $category ) {
        if ($category->name == 'aVideo'){ ?>
     
      <?php
      $post_id = $post->ID; // current post ID

      $posts = get_posts('cat=33&posts_per_page=-1000');
      // get IDs of posts retrieved from get_posts
      $ids = array();   
      foreach ( $posts as $thepost ) { 
          $ids[] = $thepost->ID;
      }  
      // get and echo previous and next post in the same category
      $thisindex = array_search( $post_id, $ids );
      $previd = isset( $ids[ $thisindex - 1 ] ) ? $ids[$thisindex-1]:0;
      $nextid = isset( $ids[ $thisindex + 1 ] ) ? $ids[$thisindex+1]:0;
      ?>
        <div class="post-pag-wrap">
      <div class="post-pag-container prev">

      <?php if ( $previd ) { ?>
        <a rel="prev" href="<?php echo get_permalink($previd) ?>"><strong style="color:#000;"><u>Prev</u></strong></a>
      <?php } ?>
      </div>
      
      <div class="post-pag-container rand">
          <a href="https://breakchill.com/?redirect_to=random"><u style="color: #000000;">Random</u></a>
        </div>
        
      <div class="post-pag-container next"> 
      <?php if ( $nextid ) { ?>
        <a rel="next" href="<?php echo get_permalink($nextid) ?>"><strong style="color:#000;"><u>Next</u></strong></a>
        <?php } ?>
      </div>  
        </div>
      <?php 
          break;
        }  
        }
    } ?>  

And then you will need to update the custom css into this:

.entry-title {
    display: none;
}

.archive .entry-title {
    display: block;
}

We would love to know if this has worked for you. Thank you.

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