The code you sent shows the culprit, if not why it is messed up or how to fix it:You have a Template Monster template, and they are notorious for changing core functions in strange ways.Code:... function tm_listing( ...
This is likely to be a nightmare to fix, and I don't have enough time to examine it now.



