• Resolved kareemsayeed

    (@kareemsayeed)


    Hi Everyone,

    I’ve known this forum to be super helpful so I’m asking a question that is somewhat relevant to Jetpack Infinite Scroll. I’ve managed to combine Date grouping with infinite scroll on my website (battledomination .com). The only problem is that I don’t know where/how to add echo to the part of code that will force the date to appear on it’s very own line. You’ll notice how the date shows up in awkward places on my site. Here is the code:

    <?php
    $date = 0;
    $newDate = true;
    if (have_posts()) : while (have_posts()) :
    the_post();

    if ($date == 0)
    $date = the_date();
    else if ($date != the_date()) {
    $date = the_date();
    $newDate = true;
    }

    if ($newDate)
    echo $date . ”;

    $newDate = false;

    echo ”;

    get_template_part(‘item-video’);
    endwhile;
    endif;
    ?>

    • This topic was modified 8 years, 1 month ago by kareemsayeed.
Viewing 1 replies (of 1 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    That will depend on how Infinite Scroll is declared on your site, and what your Infinite Scroll loop looks like (in the render parameter when declaring Infinite Scroll support, as explained here).

    I would recommend that you include your date there to make sure it is loaded every time Infinite Scroll is loaded.
    If you want the date to appear under every post, you’ll need to add it to item-video directly.

    I hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding html to php (Infinite Scroll related)’ is closed to new replies.