0
votes
2answers
266 views

Using global $post; to get featured image for custom post via WP_Query

I'm using a site-wide function to add css to the <head> of the page pull in featured images of various as a responsive page background. It works great across the rest of my site but fails on a ...
0
votes
0answers
30 views

Global post is always custom post type last post

my global $post is always taking the object of my custom post type "advertisement". So when i'm editing e.g. "Hello world" which post id is 1, it shows me post id of the last advertisement post. If ...
1
vote
1answer
682 views

How to make global post work with custom post type?

I was wondering to know if it's possible to use global posts with custom_types. I was working with this function: global $post; $myposts = get_posts('numberposts=4&offset=1& category=3,4'); ...
0
votes
4answers
574 views

Does WP have a global of $id?

I'm trying to attach an object to every post of any type. This will require post ID to populate or create my object. So, I either call global $post, or get_the_ID(), or do get_post(). I hope there is ...
0
votes
2answers
991 views

Using global $post; with custom post types

I'm working on creating a notification that will indicate when a post is less than a few days old. This is specifically for a custom post type called "news". Is there a way to use global $post; with ...