Ready to get started?Download WordPress


post_parent not set on WP3.9 (5 posts)

  1. ErwinS
    Posted 3 months ago #

    After uploading an image to a new post on WP3.9 post_parent is not set. So the attachment is not linked to the new post. How to resolve this issue?

    After selecting "uploaded to this post" a lot of images are shown.

  2. esmi
    Forum Moderator
    Posted 3 months ago #

    Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the default theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    - re-uploading all files & folders - except the wp-content folder and wp-config.php & root .htaccess files - from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.

  3. ErwinS
    Posted 2 months ago #

    I detected which plugin breaks the post-parent. Unfortunately it happens after enabling wordpress-seo plugin. Also if this plugin is the only active plugin post_parent is still set to 0. Although this does not happen with twentyfourteen. So I will investigate my custom theme.

    Thanks in advance

  4. ErwinS
    Posted 2 months ago #

    After some debugging I noticed "wp_print_media_templates" has been changed since WP3.8.3. If I now add {{ data.postId }} to the header "Drop files anywhere to upload" for uploading images I get an empty response on 3.9, although on 3.8.3 I still get the ID of the main-post (parent). This happens with and without WordPress SEO enabled. Can someone explain how a new attachment is linked to a post on WP3.9? This will help me searching for a sollution. Thanks.

  5. ErwinS
    Posted 2 months ago #

    I found out that if in your theme in functions.php "add_themesupport('post_thumbnails')" is set post_parent is also correctly set. Will test this on several other themes as well.


You must log in to post.

About this Topic