In my view loop I want to display the time that has passed since adding this particular post (e.g. 5 minutes ago / 16 days ago / etc.). I added a shortcode that does the calculation:
Actually, it worked fine in the wp dashboard, but actually viewing this on the frontend the whole site appears to be broken..?
So when I paste in your code it looks exactly like I wanted it to in the block editor. However trying to view any page on the site on multiple devices the whole site looks broken. I can fix it by removing the code. Any clue what could be causing this?
You probably don't need to use the custom Views shortcode parser (wpv_do_shortcode), you could try replacing that with the native WordPress do_shortcode() function, e.g.