How to get contextual filter of a view from page.tpl.php?
You can use the arg() function.


  Returns a component of the current Drupal path.
  
  When viewing a page at the path "admin/structure/types", for example,
  arg(0) returns "admin", arg(1) returns "structure", and arg(2) returns
  "types".


In your case:
arg(1) = [year]
arg(2) = [month]