• I Used Bellow code for print month and all post title. I use this code and I get the out put I need yet I need the month on the left hand side. When the monthly post number is even the month stay to left, however if the number is an odd number the month goes to a wrong place.

    <?php
    $blogtime = date(‘Y’);
    $prev_limit_year = $blogtime – 1;
    $prev_month = ”;
    $prev_year = ”;

    $args = array(‘post_type’ => ‘post’,’post_status’ => ‘publish’,’posts_per_page’=>-1);
    $postsbymonth = new WP_Query($args);

    while($postsbymonth->have_posts()) { $postsbymonth->the_post();

    if(get_the_time(‘F’) != $prev_month || get_the_time(‘Y’) != $prev_year && get_the_time(‘Y’) == $prev_limit_year) {?>

    <div class=”col-sm-12″>
    <h2><?php echo get_the_time(‘F, Y’)?></h2>
    </div>
    <?php } ?>

    <div class=”col-sm-6″>
    <h3>“><?php the_title(); ?></h3>
    </div>

    <?php
    $prev_month = get_the_time(‘F’);
    $prev_year = get_the_time(‘Y’);
    } ?>

    https://www.ads-software.com/plugins/wordpress/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anonymous User 9055193

    (@anonymized-9055193)

    Can you provide a link to your site or link to a screenshot so we can see what is wrong?

    What specifically do you need?

    • All post dates to be on the left?
    • Odd post dates to be on the right?

    Also, a link to a screenshot of your desired results would help.

    Thread Starter buddika987

    (@buddika987)

    https://www.test.oddly.co/opentapes/parliament-sessions/

    this is my test link.

    what i basically want is to display the posted month on the left side and the related posts under that month. the titles need to be in two columns.

    I need like this

    2015 October

    Title Title
    Title Title
    Title Title
    Title Title

    2015 September
    Title Title
    Title Title
    Title Title
    Title Title

    Or ———-Like This also ok

    2015 October 2015 September

    Title Title
    Title Title
    Title Title
    Title Title

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Print All post 2 Columns in wordpress’ is closed to new replies.