title: WordPress customized calendar next and previous year gives 404
body: <p>I have a calendar that I created in WordPress. There is a next and previous month link at the top. They navigate fine through the current year, but when the year changes to either the next or previous year, I get a 404 error.</p>
  
  <p>The link with each month looks like this (January 2014 for example): <code>mysiteurl.com/calendar-grid/?year=2014&amp;month=1</code></p>
  
  <p>I have tried just typing in the correct url with and without the <code>/</code> before the <code>?year</code> and that doesn't work.</p>
  
  <p>This is how I am getting the data:</p>
  
  <pre><code>if($_GET['month'] == ''){
      $currmonth = date('n');
      $thisyear = date('Y');
  }
  else {
      $currmonth = $_GET['month'];
      $thisyear = $_GET['year'];
  }
  $thismonth = paddNum($currmonth);
  $firstday = $thisyear.$thismonth.'01';
  $lastday = date('Ymt', strtotime($firstday));
  $numdays = $lastday - $firstday + 1;
  $firstDOW = date('N', strtotime($thisyear.'/'.$thismonth.'/01')) + 1;
  if($firstDOW == 8) $firstDOW = 1;
  $nextmonth = $thismonth + 1;
  $prevmonth = $thismonth - 1;
  $nextyear = $thisyear;
  $prevyear = $thisyear;
  if($nextmonth == 13){
      $nextmonth = 1;
      $nextyear = $thisyear + 1;
  }
  elseif($prevmonth == 0){
      $prevmonth = 12;
      $prevyear = $thisyear - 1;
  }
  $args = array(
      'post_type' =&gt; 'event',
      'meta_query' =&gt; array(
          array(
              'key'       =&gt; 'event_date',
              'compare'   =&gt; 'BETWEEN',
              'value'     =&gt; array($firstday, $lastday)
          )
      ),
      'posts_per_page' =&gt; -1
  );
  $posts = get_posts($args);
  </code></pre>
  
  <p>This is how the links are created:</p>
  
  <pre><code>&lt;div class="month-head-text"&gt;
      &lt;a class="month-prev" href="&lt;?php echo get_home_url(); ?&gt;/calendar-grid?year=&lt;?php echo $prevyear; ?&gt;&amp;month=&lt;?php echo $prevmonth; ?&gt;"&gt;
          &lt;img src="&lt;?php echo get_template_directory_uri(); ?&gt;/images/prev-month.png" /&gt;
      &lt;/a&gt;
      &lt;div class="month-name"&gt;&lt;?php echo translateMonth($thismonth); ?&gt;&lt;/div&gt;
      &lt;a class="month-next" href="&lt;?php echo get_home_url(); ?&gt;/calendar-grid?year=&lt;?php echo $nextyear; ?&gt;&amp;month=&lt;?php echo $nextmonth; ?&gt;"&gt;
          &lt;img src="&lt;?php echo get_template_directory_uri(); ?&gt;/images/next-month.png" /&gt;
      &lt;/a&gt;
      &lt;a class="close-cal" href="&lt;?php echo get_home_url(); ?&gt;/calendar"&gt;&lt;img src="&lt;?php echo get_template_directory_uri(); ?&gt;/images/close.png" /&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>here is the link for December 2014: <a href="http://houseof.mspaceap.com/calendar-grid/?year=2014&amp;month=12" rel="nofollow">http://houseof.mspaceap.com/calendar-grid/?year=2014&amp;month=12</a></p>