• Hi,

    First of all, pretty nice plugin.

    I have been able to get custom fields in a single post type. But when I try to get the same custom field from inside a page it gives an error ”
    [apr field=’web_logo’] attempting to be used on a page where there is no collection.
    “. I have this shortcode inside a custom fields, so then in the php code I do a do_shortcode().

    I have seen that the problem is that the $post doesn’t have the AirpressCollection when I get it from inside a page(or probably another post type). I understand that I created a Virtual Field for a specific custom post type, but I thought that collection would load any time I call this post type.

    There is a way to get a virtual field from one post type called inside another post type?

Viewing 1 replies (of 1 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    If you could make a screen recording walking me through this I might be able to provide some help.

    The shortcode depends on the global $post variable, however there are many circumstances where the global $post variable is changed temporarily and then changed back.

    Especially in sidebar loops and such (showing related posts or something). So I’m guessing that the shortcode is being run inside of a loop that modifies the global $post variable.

Viewing 1 replies (of 1 total)
  • The topic ‘get custom fields from custom post type in a while inside a page’ is closed to new replies.