I need help images switch issue

Hi,

I’m facing an issue with image ordering in listings. When I add images in a specific order, after some time the order changes automatically for example, the second image becomes the first and vice versa.

I want to ensure that when a listing is added or updated, the first image is always saved as the featured image, so I can reliably display it as the main image.

Could you please help fix this behavior?

Hi @ongraphdev,

I remembered this issue was mentioned previously, and I managed to find the old topic I was thinking of - it was actually yourself who created it! :sweat_smile:

In the previous topic, you seem to have eventually worked out that disabling the HivePress cache solved the issue for you. Is this no longer the case?

Have you also tried temporarily deactivating any third-party plugins and/or customisations, then checked if the issue is resolved?

As mentioned in the previous topic, without being able to consistently reproduce the issue; providing a solution is near-enough impossible due to the endless number of variables involved.

Cheers,
Chris :victory_hand:

This issue is not related to cache. The images are switching on the backend itself, even without changing the order. Could you please help me understand why this is happening and suggest a solution?

I would like to set the first uploaded image as the featured image when a listing is created or updated. Currently, the featured image is not appearing for the hp_listing post type.

I have tried enabling and setting the featured image programmatically, but the code does not seem to be working.

Could you please help me understand if there is any issue with displaying the featured image for this post type, and which hook should be used to reliably set the first image as the featured image?

Hi @ongraphdev,

​To clarify, what you’re describing is the default behavior in HivePress. Under normal conditions, you shouldn’t need any code snippets to set the featured image.

​Since we haven’t seen other reports of this, the issue is almost certainly unique to your specific environment. It is very likely caused by a third-party plugin conflict or a custom code snippet on your end.

​To help you get this fixed, I really need the answers to the following so I can narrow down the cause:

  • Which theme are you currently using?
  • Have you tried deactivating all third-party plugins (except HivePress) to see if the issue persists?
  • Are there any other customizations or code snippets currently active?
  • Are you using any image optimization plugins (like Smush or Imagify)?

​Troubleshooting without these details is like trying to find a needle in a haystack. Once we can identify what is unique about your setup, we can find the solution.

​Looking forward to your findings so we can get this resolved!

​Cheers,
Chris :victory_hand:

Hi,

I’m sorry that you’re still experiencing this issue.

We would like to investigate it further. Could you please provide all the steps you take when creating a new listing that changes the images on the backend? We want to make sure we follow exactly the same process. You can also record a screencast.

If possible, please perform this process with only the HivePress plugins enabled to rule out any conflicts. Additionally, please let us know your WordPress, HivePress, and PHP versions.

If there is a bug, we are interested in identifying and fixing it.