• Regarding the calendar feature:

    On the calendar there are links at the bottom – below the dates – that shows a link for the previous month on the left side and the next month on the right side.

    Example for month of December:

    << Nov Jan>>

    By default, if you select the Nov link, it changes the page contents to an archive listing of posts for the month of November.

    How would I change the links so that when you select the Nov link, the contents of the page that you are viewing doesn’t change -the only thing that changes is the calendar display from December to November?

    Like toggle switches that can change the calendar display from one month to another.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter rvblog

    (@rvblog)

    Well, if nobody knows the answer to this then …

    Does anyone know which *.php file contains the calendar code so I can try and figure out how to change the links ??

    Thanks

    Thread Starter rvblog

    (@rvblog)

    Ok, this may be the code that needs to be changed:

    // Get the next and previous month and year with at least one post
    $previous = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
    FROM $wpdb->posts
    WHERE post_date < '$thisyear-$thismonth-01'
    AND post_status = 'publish'
    ORDER BY post_date DESC
    LIMIT 1");
    $next = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
    FROM $wpdb->posts
    WHERE post_date > '$thisyear-$thismonth-01'
    AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' )
    AND post_status = 'publish'
    ORDER BY post_date ASC
    LIMIT 1");

    echo '<table id="wp-calendar">
    <caption>' . $month[zeroise($thismonth, 2)] . ' ' . date('Y', $unixmonth) . '</caption>
    <thead>
    <tr>';

    $day_abbrev = $weekday_initial;
    if ($daylength > 1) {
    $day_abbrev = $weekday_abbrev;
    }

    $myweek = array();

    for ($wdcount=0; $wdcount<=6; $wdcount++) {
    $myweek[]=$weekday[($wdcount+$week_begins)%7];
    }

    foreach ($myweek as $wd) {
    echo "ntt<th abbr=\"$wd\" scope=\"col\" title=\"$wd\">" . $day_abbrev[$wd] . '</th>';
    }

    echo '
    </tr>
    </thead>

    <tfoot>
    <tr>';

    if ($previous) {
    echo "ntt".'<td abbr="' . $month[zeroise($previous->month, 2)] . '" colspan="3" id="prev"><a href="' .
    get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $month[zeroise($previous->month, 2)], date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">&laquo; ' . $month_abbrev[$month[zeroise($previous->month, 2)]] . '</a></td>';
    } else {
    echo "ntt".'<td colspan="3" id="prev" class="pad">&nbsp;</td>';
    }

    echo "ntt".'<td class="pad">&nbsp;</td>';

    if ($next) {
    echo "ntt".'<td abbr="' . $month[zeroise($next->month, 2)] . '" colspan="3" id="next"><a href="' .
    get_month_link($next->year, $next->month) . '" title="View posts for ' . $month[zeroise($next->month, 2)] . ' ' .
    date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year)) . '">' . $month_abbrev[$month[zeroise($next->month, 2)]] . ' &raquo;</a></td>';
    } else {
    echo "ntt".'<td colspan="3" id="next" class="pad">&nbsp;</td>';
    }

    echo '
    </tr>
    </tfoot>

    Does anyone have an idea what needs to be changed ??

    Thread Starter rvblog

    (@rvblog)

    I didn’t think that this question would be that difficult for the coders out there.

    If it can’t be done can someone let me know so I can scrap the calendar idea that I wanted to try.

    Thanks

    From what file is that code?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Calendar Links’ is closed to new replies.