I have a few websites where I have coded a custom feature to get data from the database, these are all older sites. the page fetches info by grabbing the last part of the url and turning it into the variable 'item'
this used to work, but now it no longer does. something is stripping off the last part of the url and it's just loading example.com/item/
The workaround of changing the url to
has 'fixed' it but I'd rather the other url. Can anybody shed any light on what has happened here? I believe this happened on a wordpress update a couple of versions ago.
** edit to add some code **
this is in the theme's header.php file
I use the plugin pods to create custom tables so i'm using it's db query functions
$itemURL = 'https://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; $bits = explode("item/",$itemURL); $showItem = rtrim($bits,"/"); $customPod = pods('custom_jewellery'); $params = array('where' => 'id = "'.$showItem.'"'); $customPod->find($params); while($customPod->fetch()): $customItem['id'] = $customPod->field('id'); endwhile;