WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Types & Post meta only working when logged in (2 posts)

  1. brianj
    Member
    Posted 3 years ago #

    I created a plugin file called realestate.php so that I could add a custom post type named "Listings" . Within the edit screen of this custom post type, the plugin creates a custom meta box to store values for things like "Price", "Beds", "Baths" etc.

    When I query posts from post_type=listings and the meta data within any page or post template, it doesn't fetch any of the values....EXCEPT for one template file named single-property.php.

    Weirdest part about this......it all works when I am logged as an admin! While logged in, I go to the front end and all pages work perfectly, the posts from my custom post type of "listings" are pulled in correctly, the meta values ...etc . It all works when I have an active login....I log out, and it all disappears.

    Thanks for any help in advance. This is killing me right now

    Is there something missing from my plugin file realestate.php ? I just added 'publicly_queryable' => true, thinking that was it, but didn't change anything

  2. Helen Hou-Sandi
    WordPress Dev
    Posted 3 years ago #

    This has to do with meta capability mapping. See more at http://wordpress.org/support/topic/custom-post-type-only-working-when-logged-in

Topic Closed

This topic has been closed to new replies.

About this Topic