• Resolved mc3digital

    (@mc3digital)


    I have been searching for hours to try and figure out why the most recent post is not showing up on this page. It you look in the sidebar, the archives will show a link to the first post of 2024. There are no caching plugins that I see installed. As well, I just tried using the posts in the block editor. It also shows the last post from 2023 instead of the most recent one. I tried setting another page as the blog posts page in the theme editor. Same results.

    How do I force the site to show the most recent post first?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • abletec

    (@abletec)

    Hello mc3digital, and welcome.

    I hate to ask the obvious, but did you actually publish the post, as opposed to it being a draft? Because I’m seeing what you’re seeing–your last post was in 2023. I really don’t mean to insult your intelligence, but as someone who’s been around the block more than once (as in, having to travel 50mi one way because a client’s plug wasn’t connected, you do want to cover that ground.

    Also, please make certain the posts page is set to “News and Views” in the ‘Settings > Reading’ menu of your dashboard.

    Thread Starter mc3digital

    (@mc3digital)

    I hate to ask the obvious, but did you actually publish the post, as opposed to it being a draft?

    Yes, it is published. I doubled checked before posting here. As well, you can see the post if you scroll down to the archives in sidebar and in 2024 you will see a published post. I wish the solution was that simple. I tried to mention that in the first post but didn’t do so very clearly.

    Also, please make certain the posts page is set to “News and Views” in the ‘Settings > Reading’ menu of your dashboard.

    It is. I also tried changing the page after creating a new one just to test things out. Same results on both pages.

    The theme I inherited has a lot of hands in it before me, and the site is 10 years old apprx. I was wondering if that had something to do with it. I reviewed that in detail, including searching for function calls. Nothing. I can’t find an override (plus I made a new page to try getting around this).

    Can’t find anything to indicate why I can’t get this post to show up. I even used the block editor to display posts and the most recent one was not included.

    Also checked for caching plugins and the only one I saw WP Rocket is disabled.

    Still stuck on this if anyone has ideas…

    • This reply was modified 7 months ago by mc3digital.
    • This reply was modified 7 months ago by mc3digital.
    abletec

    (@abletec)

    @mc3digital, could you please switch to a default theme & see if there’s any change?

    abletec

    (@abletec)

    @mc3digital, it’s there now. So that suggest some sort of time lag. There are several things that could cause this.

    1. You intentionally or inadvertently scheduled the post;
    2. The visibility was not set to public;
    3. Your wp-cron.php didn’t fire as expected;
    4. Your host may have caching that doesn’t show up in WordPress.

    wp-cron is WordPress’s attempt at a scheduling facility. Unfortunately, it can be a bit finicky, as in, if there’s too much or too little site traffic, it may not work as expected.

    Most folks feel that if you have a hosting control panel that permits setting up user cron jobs, it’s considered best practice to disable wp-cron and set up a true cron job in your control panel or via other generally more advanced methods. An article on how to do that is here:

    https://www.wpbeginner.com/wp-tutorials/how-to-disable-wp-cron-in-wordpress-and-set-up-proper-cron-jobs/

    I can’t quite determine who hosts your site, but you may wish to check w/them regarding whether or not they have a caching facility installed that may have delayed the appearance of your post.

    Please let us know.

    Moderator bcworkz

    (@bcworkz)

    It looks like you are using CloudFlare? I don’t use it myself, but I believe their service includes some sort of caching scheme. If so, look through CloudFlare docs or ask their support about caching and how you can flush the cache so new posts appear quickly.

    Or maybe exclude the News and Views page from caching? This would slow down page loads but visitors will always see the latest posts without you needing to do anything more than publish the post.

    Thread Starter mc3digital

    (@mc3digital)

    The post is live on the site, but not displaying on the page I linked to, the issue persists.

    I switched themes and did see it in a list of recent posts. I guess this means it could be code in the functions.php file or something? I am running out of ideas as to where to look.

    I do not have full server access. I think we are using cloudflare, but I do not have the controls to adjust this. I am not sure this page is cached at all since I made a similar, new page to work around this idea and that other page, when set to the posts page in the WP settings also didn’t show it.

    It does show up on the front page which is loaded via the function wp_get_recent_posts().

    I found some suspicious code in my functions.php file. Commenting this out resolved the issue. I found a pattern in that there was 2 posts which get tagged as app alerts, which load into our mobile app. I noticed that these were not in the list of posts. They were for some reason being excluded from the ‘view all’ lists using this method…

    function exclude_category_newspage( $query ) {
    if ( $query->is_home() ) {
        $query->set( 'cat', '-878' );
    }
    return $query;
    }

    Oh how fun it is to go over other peoples work.
    Thank you all for taking a look!

    • This reply was modified 7 months ago by mc3digital.
    abletec

    (@abletec)

    @mc3digital, I’ve had a look at your theme’s code. Some of it isn’t even working now. This appears to me to be pretty old code. Actually very old code, if the truth be told.

    I’m beginning to think the theme is part, if not all, of the problem. The fact that changing themes made the post appear tends to support that possibility. I know that’s not what you want to hear, but you know–as w/anything, stuff becomes outdated and needs to be replaced sometimes. This is especially true of highly customized themes.

    An additional possibility is that there’s a conflict occurring w/1 of your plugins, but from what I’m seeing, I really think the theme is problematic.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Most recent posts not showing up on blog posts page’ is closed to new replies.