WordPress.org

Ready to get started?Download WordPress

Forums

In Over Your Archives
fixed link to previous year (2 posts)

  1. cherac11
    Member
    Posted 2 years ago #

    <?php if($prev_year_posts->have_posts()) : ?>
    <!-- current_month + 11)); ?>" class="prevyear" rel="<?php echo ($current_year-1) . ioya_format_month($current_month) ?>">< -->
    ioya_format_month($current_month + 11) ?>" class="prevyear" rel="<?php echo ($current_year-1) . ioya_format_month($current_month) ?>"><
    <?php endif; ?>

    pretty much replace instance of : .'/ioya/'.($current_year + 1) .'/'. ioya_format_month($current_month)

    which outputs this for url: .../ioya/yyyy/mm

    the code changes above to match the wordpress link format: /?m=yyyymm

    http://wordpress.org/extend/plugins/in-over-your-archives/

  2. Scutum
    Member
    Posted 2 years ago #

    I am not sure if that code you posted is complete, but I keep getting a fatal error trying to replace:

    <?php if($prev_year_posts->have_posts()) : ?>
    				<!-- <a href="<?php echo get_month_link($current_year - 1, ioya_format_month($current_month)); ?>" class="prevyear" rel="<?php echo ($current_year-1) . ioya_format_month($current_month) ?>"><</a> -->
    				<a href="<? echo get_site_url() .'/ioya/'.($current_year - 1) .'/'. ioya_format_month($current_month) ?>" class="prevyear" rel="<?php echo ($current_year-1) . ioya_format_month($current_month) ?>"><</a>
    			<?php endif; ?>

    ...with what you posted. Can you show exactly what I'm supposed to do? And how would you modify this to replace the code for next_year_posts as well?

    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic