Title: IceFlame5's Replies | WordPress.org

---

# IceFlame5

  [  ](https://wordpress.org/support/users/iceflame5/)

 *   [Profile](https://wordpress.org/support/users/iceflame5/)
 *   [Topics Started](https://wordpress.org/support/users/iceflame5/topics/)
 *   [Replies Created](https://wordpress.org/support/users/iceflame5/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/iceflame5/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/iceflame5/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/iceflame5/engagements/)
 *   [Favorites](https://wordpress.org/support/users/iceflame5/favorites/)

 Search replies:

## Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/page/2/#post-4303311)
 * i actually got it working! Thanks for your help. I found out the issue. its monthnum
   it needs to be an integer and we were giving it a string before. Thus = fail 
   so this is what i did.
 *     ```
       <?php
       list( $month, $year ) = explode( '-', basename( __FILE__, '.php' ) );
       $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
       							if($month=="january"){
       $month = "1";
       }else if($month=="february"){
       $month = "2";
       }else if($month=="march"){
       $month = "3";
       }else if($month=="april"){
       $month = "4";
       }else if($month=="may"){
       $month = "5";
       }else if($month=="june"){
       $month = "6";
       }else if($month=="july"){
       $month = "7";
       }else if($month=="august"){
       $month = "8";
       }else if($month=="september"){
       $month = "9";
       }else if($month=="october"){
       $month = "10";
       }else if($month=="november"){
       $month = "11";
       }else if($month=="december"){
       $month = "12";
       }
   
       $args = array(
       'posts_per_page' => 10,
       'paged'          => $paged,
       'year'           => $year,
       'monthnum'       => $month,
       );
       $the_query = new WP_Query( $args );
   
       while ( $the_query->have_posts() ) : $the_query->the_post(); 
   
       echo "<h2>"; the_title(); echo "</h2>";
       echo "<span style='font-size:11px;'>By <a href='/company/employees/cameronandrews.php'>"; the_author(); echo "</a> | Published "; the_date(); echo "</span><br /><br>";
       the_content(); 
   
       endwhile;
   
       ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/page/2/#post-4303309)
 * Doesnt seem to change the outcome.
 * [http://cameronandrews.com/blog/archives/november-2013.php](http://cameronandrews.com/blog/archives/november-2013.php)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/#post-4303305)
 * Yeah here you go:
 *     ```
       <?php
                                   require('../blog/wp-blog-header.php');
       							require('../blog/wp-includes/general-template.php');
                                   ?>
   
                                   <?php
       							list( $month, $year ) = explode( '-', basename( __FILE__, '.php' ) );
       							$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
       							$args = array(
       								'posts_per_page' => 10,
       								'paged' => $paged,
       								'date_query' => array(
       									array(
       										'year'  => (int) $year,
       										'month' => (int) $month,
       									),
       								),
       							);
       							$posts = get_posts( $args );
   
                                   foreach ($posts as $post) : setup_postdata( $post ); 
   
                                    echo "<h2>"; the_title(); echo "</h2>";
                                    echo "<span style='font-size:11px;'>By <a href='/company/employees/cameronandrews.php'>"; the_author(); echo "</a> | Published "; the_date(); echo "</span><br /><br>";
                                    the_content(); 
   
                                   endforeach;
   
                                   ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/#post-4303302)
 * UH OH. i figured out how to publish it so it was in say september, but it still
   pulls the post.
 * [http://cameronandrews.com/blog/archives/november-2013.php](http://cameronandrews.com/blog/archives/november-2013.php)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/#post-4303301)
 * Is there a way i can make a “test” post for say a month from now or a month ago
   to make sure it doesnt pull that post. Because it seems to be working now but
   just in case i want to test. and i very much thank you for your help.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/#post-4303299)
 * prints this “november2013”
 * [http://cameronandrews.com/blog/archives/november-2013.php](http://cameronandrews.com/blog/archives/november-2013.php)
 * and yes i did put the dash as you can tell by the link above.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/#post-4303297)
 * Never mind the basic php worked. but the code to pull the month and such didnt.
   Ideas as to why?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/#post-4303294)
 * Doesnt seem to show anything.
 * [http://cameronandrews.com/blog/archives/november-2013.php](http://cameronandrews.com/blog/archives/november-2013.php)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/#post-4303290)
 * So it would be this? Because this is not working. Sorry for the hassle.
 * [http://cameronandrews.com/blog/archives/november-2013.php](http://cameronandrews.com/blog/archives/november-2013.php)
 *     ```
       <?php
                                   require('blog/wp-blog-header.php');
       							require('blog/wp-includes/general-template.php');
                                   ?>
   
                                   <?php
   
       							list( $year, $month ) = explode( '-', basename( __FILE__, '.php' ) );
   
       							$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
       							$args = array(
       								'posts_per_page' => 10,
       								'paged' => $paged,
       								'date_query' => array(
       									array(
       										'year'  => (int) $year,
       										'month' => (int) $month,
       									),
       								),
       							);
       							$posts = get_posts( $args );
   
                                   foreach ($posts as $post) : setup_postdata( $post ); 
   
                                    echo "<h2>"; the_title(); echo "</h2>";
                                    echo "<span style='font-size:11px;'>By <a href='/company/employees/cameronandrews.php'>"; the_author(); echo "</a> | Published "; the_date(); echo "</span><br /><br>";
                                    the_content(); 
   
                                   endforeach;
   
                                   ?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Post posts from certain month on external site](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/)
 *  Thread Starter [IceFlame5](https://wordpress.org/support/users/iceflame5/)
 * (@iceflame5)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/post-posts-from-certain-month-on-external-site/#post-4303278)
 * Doesn’t seem to work. I am basically building an archive system manually.
 * You go to recent posts and and shows the most up to date posts at the moment 
   that is November. But when it turns to December and i click the November archive
   i want it to display only posts from November. and then when i click the December
   archive it only shows posts from December.
 * I say manually because then all i have to do is change either a number or a word
   in the programming for each new paged archive.
 * SO at the moment i have:
 * blog/index.php <- Recent Posts (Contains a sidebar where the archives are)
    blog/
   archives/november2013.php <- Only November Posts
 * —
 * when December hits i will copy the code from november2013.php and make a new 
   page called december2013.php and just change the number or word that gives it
   the month thus making it work for December 2013.

Viewing 10 replies - 1 through 10 (of 10 total)