My WordPress site has a Custom Post Type "car", so I have something like www.example.com/car/honda-civic-2013/
Now I have also an action "buy" using add_rewrite_endpoint()
displaying specific information: www.example.com/car/honda-civic-2013/buy
In my header.php
template, what is the appropriate way to check that the current page is not "buy"?
Here's what I have:
if (is_singular('car')) {
echo "Click here to buy this car";
}
It works but it also displays "Click here to buy this car" on the /buy page which I want to avoid!
I want a permanent solution, meaning that I don't want to check against "buy" in particular, but check against ANY /sub-action so the above is echoed only on the main CustomPostType page.
Thank you for any help