Wordpress - Conditional Statement - Query Category and display content on single post page.
$30-45 USD
Completed
Posted almost 14 years ago
$30-45 USD
Paid on delivery
I need some conditonal php code to show specific content on the single post template based on the category.
Basically, I want to display an advertisement based on category.
**The single post is listed under multiple categories so the code needs to perform a query to see what category the site visitor clicked on to arrive at that page and then display the correct ad for that category.**
There are 6 main level categories which will create the ad zones. Any child categories will need to show the ad of the main category.
For example a postA is under cat1> Subcat2 and also under Cat3 > subcat5
If the site visitor clicks on CAt1 subcat2 they will get the cat1 advertisement and if they click on Cat3 subcat5 they will get the cat3 ad.
**Note:** the code should also be able to be used on the sidebar to perform the same function for two more ad spots.
## Deliverables
You should be familiar with Wordpress.
The solution must work with the multiple categories.
Please let me know any questions! Thanks.