[ad_1]
I want to show/hide content in the footer based on the post type. I’ve tried using `get_post_type` which works on pages but returns nothing on posts (custom).
What’s the best way to get this working? Thanks in advance!
[ad_2]Copyright © 2020 - 2022, Project DMC - WordPress Tutorials for Beginners- All Rights Reserved. Privacy Policy
Can you show the code you’re using? get_post_type(); is exactly what you want here and works everywhere.
To verify I wasn’t misremembering I just tossed a call in my footer for it and it prints out the proper post type of every area of my site. Page, Post, Custom Post TYpes, etc.
So there must be something else going on with your code.