Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I guess you could always try to add a loop to it.
    Something along the lines of:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php endwhile; endif; ?>

    ??? I don’t know if this should or would work… Add it to your gallery page template and try to see if it works.

    Thread Starter realitym

    (@realitym)

    Thank you, it was just what I was looking for.
    I just added the get_the_category() and it did what I was looking for.

    About the queries, it does make some intense jumps on it, but I don’t expect it to be a highly visited page on the site, since there are hardly any links pointing to it. But should someone stumble upon it, I wanted them to find a nice looking page. ??

    Let’s hope someone comes up for a more query-friendly solution in the future.

    Once again, thank you so much.

    Thread Starter realitym

    (@realitym)

    Ok. I’ve gotten something so far, that looks like this:

    • August 2005
    • Post 1 (in august)
    • Post 2 (in august)
    • Post 3 (in august)
    • Post 4 (from july)

    I’ve gotten to it by finding some Nicer Archives hack and modifying it a bit and made it a Plugin, the code of which can be found: https://pastebin.com/336747

    And by adding the following in my date.php template (obviously after the if is_year part:
    <?php
    if ($posts) {
    print '<ul>';
    $prevDays = array();
    foreach ($posts as $post) { start_wp();
    $day = " "; //get_day_nice(the_time("d", false));
    $year = get_archive_header('<li class="arch-year">', '</li>');
    $output = '';
    if ($prevDay != $day) {
    if ($prevDay) { $output .= "</ul></li>"; }
    $output .= $year;
    // $output .= '<li class="arch-day">';
    $output .= '<ul class="arch-post">';
    }
    print $output;
    print '<li class="arch-post"><a href="'. get_permalink() .'" rel="bookmark" title="'; the_title(); print'">'; the_title(); print '</a></li>';
    $prevDay = $day;
    }
    print "</ul></li>";
    print '</ul>';
    } else { // end foreach, end if any posts ?>
    Nothing to show here.
    <?php } ?>

    So, any ideas from there? Or something totally different that’ll get me what I want?

    BTW: I have no idea where I got the code from… I’d love to give credit to whoever wrote it, but as I’ve been downloading things here and there… well, you get the point. So, if it’s yours please do say.

Viewing 3 replies - 1 through 3 (of 3 total)