Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    You can do it with a loop like this:

    <ul>
    <?php query_posts('posts_per_page = -1'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
     <?php
     $Year= get_the_date( 'Y' );
     $Month = get_the_date( 'F' );
     $Day = get_the_date( 'j' );
     ?>
      <?php if($Year != $temp_year) : ?>
      <h2><?php echo $Year ?></h2>
      <?php endif; ?>
      <?php if($Month != $temp_month || $Year != $temp_year) : ?>
      <h3><?php echo $Month; ?></h3>
      <?php endif; ?>
        <li><span><?php echo $Day; ?></span><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
      <?php
      $temp_year = $Year;
      $temp_month = $Month;
    	?>
    <?php endwhile; endif; ?>
    </ul>

    Moderator keesiemeijer

    (@keesiemeijer)

    I put it in the theme’s index.php. get it here: index.php

    Thread Starter sparkling

    (@sparkling)

    Thanks Keesie. I’ve put this into my index file but the loop seems to be neverending. Have I put it in the right place?

    Moderator keesiemeijer

    (@keesiemeijer)

    The pastebin link code is all code that goes in the index.php. On my testserver it is not a neverending loop. can you put what you have now in the pastebin and give us the link

    Thread Starter sparkling

    (@sparkling)

    Great- was adding the code so breaking it.

    Have now replaced everything in index filewith code from the paste bin and it’s working. Could you just let know where to change the formatting?

    Really, really appreciate your help here..

    Moderator keesiemeijer

    (@keesiemeijer)

    The formatting is done in your theme’s stylesheet style.css

    look for:

    li{line-height: 18px; padding: 6px 0 0 0;}

    change it to:

    li{
    	list-style-type: none;
    	line-height: 18px; padding: 6px 0 0 0;}
    
    li span {
    	padding-right: 1em;
    }

    for some formatting.

    Thread Starter sparkling

    (@sparkling)

    With your help, I’m 99.9% there!

    If you could help me just get over the finish line some some formatting…

    Website is here

    The very small changes I’d like are here. I’ve tried lots of different things but I just need the second line up with the first and those two gaps made smaller.

    Plus I’d like “all posts” to appear underneath the latest post like on https://www.mnmlist.com

    ??

    Moderator keesiemeijer

    (@keesiemeijer)

    For the title here is a new index.php

    Moderator keesiemeijer

    (@keesiemeijer)

    As for formatting, look in your css for h2, h3 and ul and change the padding or margin to your liking:

    h2 {font-size: 3.2em; color:#333; line-height:20px; font-weight:normal;
    margin: 0 0 .4em 0;}
    h3 {font-size: 9pt; color:#000000;
    margin: 0 0 0 0;
    }
    
    ul{padding: 0 0em 1em 3.2em;}
    Thread Starter sparkling

    (@sparkling)

    Amazing- thanks Keesie!

    Moderator keesiemeijer

    (@keesiemeijer)

    This is a better version of index.php . It resembles your page.php more. use this version

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Latest post plus archive on home page- How?’ is closed to new replies.