Support » Plugin: Content Blocks (Custom Post Widget) » Featured images suddenly not working anymore

  • Resolved elfacht

    (@elfacht)


    Hi,

    I’m just working on WordPress where everything’s just fine. I updated to WP 3.5 and still: everything’s cool. Suddenly, out of the nothing, the featured images function in WP is not working anymore. Here is what happens:

    – I’m editing a page/post (not a custom post widget – a regular page)
    – Setting the featured image
    – A random image is already selected
    – I set it, the preview appears
    – I save the page and the image disappears

    I was wondering about that because I didn’t make any changes and minutes before it worked like a charme. Then I deactivated all my plugins and I just found out that this plugin causes the trouble.

    The images I set before are still there, I just can’t set new ones. The upload itself still works fine.

    Any suggestions?

    Cheers,
    Martin

    http://wordpress.org/extend/plugins/custom-post-widget/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Ok, I just rolled back to WordPress 3.4.2 and it works fine again. I guess it’s because of the new media upload manager in WP 3.5. I’ll have to wait for an update then …

    Same here.
    Need a fix ASAP!

    Btw. Thank you, developers, for great work!

    Plugin Author Johan van der Wijk

    (@vanderwijk)

    Hi Martin and q-styler,

    Since the custom post widget plugin does not have any code related to featured images, I wonder if you could provide me with some more details. Are you using the code snippet from this page to display the featured image? http://wordpress.org/extend/plugins/custom-post-widget/faq/

    Could you enable debug and let me know which (if any) errors are displayed?

    Hi Johan,

    I’ve found the problem, but not the reason: If I deactivate the “Advanced Custom Field” plugin, everything works fine. If I active the plugin and deactivate the CPW plugin it works fine, too. I guess, the two plugins doesn’t really like each other.

    So, who’s to blame? 🙂

    Cheers
    Martin

    i get the same problems, maybe it’s come from the same name for an function ?

    i found a way, the problem comes from post-widget.php at the end for add_action(‘admin_footer’, ‘add_content_block_popup’);

    if you disable this, the featured image works again. I suspect the bug comes from popup.php

    ok, in fact the bug comes from the Query post and conditional if

    <?php query_posts('post_type=content_block&orderby=ID&order=ASC&showposts=-1');
    							if ( have_posts() ) : while ( have_posts() ) : the_post();
    								$currentID = get_the_ID();
    								if($currentID == $custom_post_id)
    									$extra = 'selected' and
    									$widgetExtraTitle = get_the_title();
    								else
    									$extra = '';
    									echo '<option value="'.$currentID.'" '.$extra.'>'.get_the_title().'</option>';
    								endwhile; else:
    								echo '<option value="empty">' . __('No content blocks available', 'custom-post-widget') . '</option>';
    							endif; ?>
    Plugin Author Johan van der Wijk

    (@vanderwijk)

    I have extensively tested this and I cannot reproduce this error. I am very disappointed that some people have marked my plugin as ‘broken’ while I have not received any specific evidence that this is the case. I have installed my plugin on almost all my customer sites and have received zero complaints about the featured image functionality.

    It does not make any sense for the custom post widget plugin to break the featured image functionality since there is nothing in the code relating to this.

    Plugin Author Johan van der Wijk

    (@vanderwijk)

    @martin, please run a search for “Advanced Custom Field” in the plugin directory and tell me how I am supposed to find out exactly which plugin you are using…

    Hi Johan,
    i found exactly where the problem comes from but i don’t know why ?
    it seems the while doesn’t works correctly and try to rewrite some parameters for posts, i try to put reset wp_query but no result, i fixed the problem to using foreach instead while in popup.php :

    $args = array('post_type' => 'content_block','suppress_filters' => 0, 'numberposts' => -1, 'order' => ASC);
    						$custom_post_widget_lists = get_posts($args);
    							foreach($custom_post_widget_lists as $custom_post_widget_list) {
    								if(isset($custom_post_id)){
    									$currentID = $custom_post_widget_list->ID;
    								}
    								$currentID = get_the_ID();
    
    								if($currentID == $custom_post_id)
    									$extra = 'selected' and
    									$widgetExtraTitle = get_the_title();
    								else
    									$extra = '';
    									echo '<option value="'.$custom_post_widget_list->ID.'" '.$extra.'>'.$custom_post_widget_list->post_title.'</option>';
    								}

    PS : me too, i use Advanced custom fields, this bug appears only on WP 3.5 and maybe when you have ACF installed, but it strange because in WP 3.4.2 and last ACF installed no problem all is working.

    Any closer to solving this issue? I have the same problem, i set a featured image which shows in the featured image pane until i click update, it disappears. If i disable the ACF plugins, everything works as it should.

    Have you tried my fix ?

    Plugin Author Johan van der Wijk

    (@vanderwijk)

    Hi creativexperience, thanks for sharing your solution! Unfortunately I am swamped with work at the moment, but as soon as I find some time, I’ll test it and release a new version of my plugin.

    Plugin Author Johan van der Wijk

    (@vanderwijk)

    Ok, I have created a new version of the plugin that should fix this issue.

    Could you please test this beta version and let me know if this works? http://downloads.wordpress.org/plugin/custom-post-widget.zip

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Featured images suddenly not working anymore’ is closed to new replies.