One of the tiles in that area is displaying twice, and I can't figure out why.

One of the tiles on the page is displaying twice, and I can't figure out why.
A link to a site:
https://www.stand-together.org/catalyst-network/

Just click the load more button and scroll down to see that The Phoenix page is showing up twice.

  • Sohag Ronjon Dey

    Hi Alex,

    Hope you are doing well. :slight_smile:

    I have gone through your site and tried to replicate the issue. I have copied the template used in this page and created a new template. I have found that in my test page when the load more button is not there and all the posts(catalyst) are loaded and there is no duplicate of the phoenix catalyst. So it suggests the load more button event is creating any conflict. I have tried to investigate that script but could not as it seems the staging site has some caching enabled. Please check the script. And if possible disable the cache for the staging site and let us know.

    Cheers,
    Sohag

  • Adam Czajczyk

    Hello Alex,

    I took a look at the staging site and there's no "Load more" button currently for me. I assume that it's just a matter of enabling/changing some option but even then, it seems you only shared FTP credentials via chat and I don't have access to the site.

    As I'd like to take a closer look at it, would you mind enabling support access to the staging site (and setting the site in a way that the "Load more" button was there)? You can do this on "WPMU DEV -> Support" page in site's back-end by clicking on "Grant support access" button.

    Let me know here when you're ready, please.

    Kind regards,
    Adam

  • Adam Czajczyk

    Hi Alex,

    I checked the site "in and out" but I'm still not sure why this happens. I did notice that after you click "load more" it does read more posts of "catalysts" type but even those posts are "broken" in a sense that their links are wrong.

    That made me dig deeper so I accessed your site via FTP and let myself download your theme and check it. It seems that "Load more" button is handled by JS script that's:

    - fetching "more posts" via WP REST API
    - processing data
    - filling out the grid

    If you check this file

    /assets/javascript/custom/catalyst-landing.js

    you'll find this line there:

    <a href="\/${el.slug}" class="catalyst-card">

    Basically, it looks like it was simply putting post slug (which obviously doesn't include protocol prefix, domain name and other parts of the "real" permalink here) as a link. So that would explain the "broken" links.

    I realize that this is not an issue that you were asking about but I got a feeling that this is all related here. For example, if I add "?count=2" to the URL right away - not by clicking "Load More" button but directly visiting http://stand2gether.staging.wpengine.com/catalyst-network/?count=2 address in a browser - I'm not only getting all the URLs proper but also no "doublets" there.

    I'm not sure however if and how to "dig deeper" with as this seems to be heavily custom(ized) theme and that might become a bit outside the scope of this forum. Hopefully, above might give you some "starting point"?

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.