Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter er.deepak

    (@erdeepak)

    oops…

    https://localhost/sitename/?post_type=events is also not working actually..

    how to get such links

    Thread Starter er.deepak

    (@erdeepak)

    made different template with own loop..

    now links has this format in navigation:

    /?page_id=108&eventday=1″>

    Thread Starter er.deepak

    (@erdeepak)

    and template has following:

    if ( ($_GET[‘eventday’]==1)) //if variable is passed 1
    {
    $todayDate = date(“Ymd”); //get post date
    $postDate = strtotime(date(“Ymd”, strtotime($todayDate)) . “+1 day”); // add 1 day
    $post_year = date(‘Y’, $postDate); //fetch which year to serve in query (tommorows year)
    $post_month = date(‘m’, $postDate); // fetch which month to put in query (tommorows month)
    $post_day = date(‘d’, $postDate); // fetch which date (tommorow date)
    $query = new WP_Query( ‘year=’ . $post_year . ‘&monthnum=’ . $post_month . ‘&day=’ . $post_day .’&post_status=future’); //match month and use future for future date post
    }

    <?php if ($query->have_posts()) : ?>
    <?php while ($query->have_posts()) : $query->the_post(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to list archives/post using custom types’ is closed to new replies.