• My static front page uses php code to display recent posts grouped by category using the function get_posts. I have a third-party-hosted WP using a child of the Twenty Fourteen theme.

    The problem I am now having is recent posts (like published today) are not displaying. When I force a reload with Ctrl-F5, the new posts show up, but then if I do a refresh with F5, it reverts back to not displaying the new posts.

    When I switch it to “Display Recent Posts” instead of “Static Page”. then it shows the newest posts just fine. But when I switch it back to the static home page, it continues to behave as above.

    $args = array( 'posts_per_page' => 12, 'category' => 2 );
    $reviews = get_posts( $args );
    foreach ( $reviews as $post ) : setup_postdata( $post ); 
    
    [display code]
    
    endforeach; 

    This performed just fine until the recent upgrade to 4.7.2, and now it is not.

    Any help is appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter gregcrowe

    (@gregcrowe)

    Oops. Meant to give my website: http://www.gameindustry.com.

    You can probably see what I’m talking about in the “Reviews” section in the upper left of the main content area. When you do Ctrl-F5 one or two posts show up, but when you hit F5 it goes back to not displaying them.

    Also, I am not using any caching plugin.

    Thread Starter gregcrowe

    (@gregcrowe)

    New posts take a while to show up in the feed, but even after they do, the browsers continue to have the same problems. Anyone have any ideas?

    Oh, also updating to 4.7.3 did not solve this problem.

    Just to see, I tried wp_get_recent_posts instead, but got the same result.

    • This reply was modified 9 years, 2 months ago by gregcrowe.
    • This reply was modified 9 years, 2 months ago by gregcrowe.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘New Posts Not Displayed With get-posts’ is closed to new replies.