• Resolved turzifer

    (@turzifer)


    I am using the plugin to allow unregistered users to create content with a featured image. I am using the ‘Always publish immediately’ option in the plugin settings.

    When the user submits the form, the same page reloads with a querystring (?success=1&post_id=14)
    I can grab the newly created post id and access all of its properties, except the post thumbnail. It is as if there is no post thumbmnail associated with that post

    <?php echo get_the_post_thumbnail( intval( $_GET['post_id'], 'full' ); ?>

    But when I check the admin side, I can see that there is a thumbnail image for the post. Also, as soon as I hit the edit button on the admin side, the above code starts to return the img tag with the right thumbnail image.

    I suspect, a missing database linking is completed when I request the post on the admin side.

    Or am I missing something?

    • This topic was modified 8 years, 1 month ago by turzifer. Reason: better readibility
    • This topic was modified 8 years, 1 month ago by turzifer.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help. What you describe is not normal behavior, so I suspect something is interfering with image uploads or similar. I recommend setting up a quick default WP installation and testing again, just using the default settings, plugins, and theme. That will let you know if the issue is with one of those items or with something on the server/setup itself.

    Thread Starter turzifer

    (@turzifer)

    Hi Jeff, thank you for your time. I already tested with a default wp intallation and only the “User Submitted Posts” plugin. I used twentyfifteen as the theme. the only lines I edited in the page.php was the line to include the form and the line to retreive the image.

    So you think it might be something about the server (MAMP) setup?

    Plugin Author Jeff Starr

    (@specialk)

    Yep most likely something with how the images are “uploaded” or added to the Media Library (and inserted into the database). I say this because the plugin continues to operate normally on other setups for other users. If you can grab a free web host, it would enable you to verify this and see how the plugin works on a live (non-MAMP) site.

    • This reply was modified 8 years, 1 month ago by Jeff Starr.
    Thread Starter turzifer

    (@turzifer)

    Hi Jeff,

    I moved the test site to a remote server and the result did not change.

    I submit a post with a single image (which is assigned as the featured image) and on reload of the page, the thumbnail returns empty. I refresh the page with the querystring many times to make sure it is not related with caching etc. I can access the id and every other property of the post, though.

    I can see the image in the uploads folder, together with all the different versions of it. So the image is saving process works as expected. But the featured image association of the post does not seem to exist.

    Yet, when I start to edit the post on the admin side, the association is made and the featured image can be found and displayed. I do not even have to save the edit. Marely opening the post in the admin editor is sufficient to make the association. The image is already displayed on the admin edit page (as the featured image) and on the front-end.

    As I stated above, I am using the option ‘Always publish immediately’ for the user submitted posts. This is not the default option and I do not think it has wide usage. That may explain why this behaviour was not reported before.

    Great plugin by the way. Thank you for sharing it.

    Plugin Author Jeff Starr

    (@specialk)

    I just retested this (with Always Publish Immediately) and images display normally using a default WP setup (default theme, plugins, and settings). So I’m not sure what the issue could be in your case, but you mentioned caching, so I am guessing that you are using a caching plugin..? If so, that could definitely be the issue in this case. Also note that in order to test properly, you need to use a default WP install that’s running default plugins, theme, and settings. That way you can rule out those items as possible factors.

    Plugin Author Jeff Starr

    (@specialk)

    Gonna go ahead and mark this as resolved to help keep things organized. Feel free to follow-up or post afresh with any new issues or questions. Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Post thumbnail not accessible until post is edited’ is closed to new replies.