Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter Paul

    (@armstrong698)

    just a quick note as well that might add a clue.

    The image only appears on the blog page if it is update from the full editor page, an update from the quick edit does not work.

    Plugin Author Workshopshed

    (@workshopshed)

    I suspect the UI is firing an action that is being processed by some code in the theme.

    It’s probably got something like

    add_action(‘edit_post’ ….

    Which hooks into a function to add the thumbnails

    To check this theory we can make a change to the code. On line 1117 of blogger-import.php you should find

    $importedpost->post_content = $importedcontent;
                    wp_update_post($importedpost);
                    $postsprocessed++;

    change this to be

    $importedpost->post_content = $importedcontent;
                    wp_update_post($importedpost);
                    do_action('edit_post',$importedpost->ID);
                    $postsprocessed++;
    Thread Starter Paul

    (@armstrong698)

    Hi

    I actioned your recommendation.

    I deleted all existing posts, categories and images.

    I then re-uploaded the posts and this time the upload process went all the way through without stopping to the end for the first time, which is great.

    However, the images did not show up automatically on the blog and still needs updating from the full page editor and bulk quick edit has no effect.

    Plugin Author Workshopshed

    (@workshopshed)

    Finally worked it out, the bug is on line 1264 of blogger-importer.php

    //Set the first image to be the post thumbnail (check that the blogitem class does not re-order the images)
                if ($imgcount == 1)
                {
                    set_post_thumbnail($post_id, $att_id);
                }

    Fix:

    //Set the first image to be the post thumbnail (check that the blogitem class does not re-order the images)
                if ($imgcount == 0)
                {
                    set_post_thumbnail($post_id, $att_id);
                }

    It’s was only setting the thumbnail on the second image as the counter is not incremented until after this code is run hence the first image is image zero not image one.

    Plugin Author Workshopshed

    (@workshopshed)

    This change is in the latest beta version

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Setting featured image by default’ is closed to new replies.