WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Widget
[resolved] Featured images suddenly not working anymore (22 posts)

  1. elfacht
    Member
    Posted 1 year ago #

    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/

  2. elfacht
    Member
    Posted 1 year ago #

    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 ...

  3. q-styler
    Member
    Posted 1 year ago #

    Same here.
    Need a fix ASAP!

    Btw. Thank you, developers, for great work!

  4. Johan van der Wijk
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  5. elfacht
    Member
    Posted 1 year ago #

    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

  6. creativexperience
    Member
    Posted 1 year ago #

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

  7. creativexperience
    Member
    Posted 1 year ago #

    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

  8. creativexperience
    Member
    Posted 1 year ago #

    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; ?>
  9. Johan van der Wijk
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  10. Johan van der Wijk
    Member
    Plugin Author

    Posted 1 year ago #

    @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...

  11. elfacht
    Member
    Posted 1 year ago #

  12. creativexperience
    Member
    Posted 1 year ago #

    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.

  13. cw6365
    Member
    Posted 1 year ago #

    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.

  14. creativexperience
    Member
    Posted 1 year ago #

    Have you tried my fix ?

  15. Johan van der Wijk
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  16. Johan van der Wijk
    Member
    Plugin Author

    Posted 1 year ago #

    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

  17. q-styler
    Member
    Posted 1 year ago #

    Yep. It works! Thank you very much!

  18. dbraphael
    Member
    Posted 1 year ago #

    Hello,

    Great and incredibly useful plugin. Are you going to release the above update via the depository any time soon?

    Cheers,

    Doug

  19. Johan van der Wijk
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Doug, I have just released the plugin update. I would appreciate it if you could click the 'Works' button at the bottom of the plugin homepage if it works for you.

    Feedback from other users who reported this issue would be highly appreciated too.

  20. creativexperience
    Member
    Posted 1 year ago #

    Thanks very much Johan, it's a pleasure to contribute for your plugin :)

  21. Johan van der Wijk
    Member
    Plugin Author

    Posted 1 year ago #

    * Rant mode on *

    It is quite disappointing to see that nobody made the ‘effort’ of clicking on the 'Works' button in the Compatibility section after updating the plugin, while people have clicked the 'Broken' button because of the conflict with the ACF plugin, causing a huge drop in downloads of my plugin.

    This kind of behaviour really makes me consider going commercial. Not that I think buyers of commercial plugins are more courteous, but at least I would get something in return for sacrificing my spare time on helping others :(

    * Rant mode off *

    This rant of course does not apply to the kind people in the WordPress community like creativexperience who helped troubleshooting this particular issue.
    Quite a few people have contributed in improving this plugin, and I always mention them in the release notes: http://wordpress.org/extend/plugins/custom-post-widget/changelog/

  22. creativexperience
    Member
    Posted 1 year ago #

    Hi Johan, i didn’t get the chance to try the new version because of lots of work. Besides, this week we launch our new website! I hope I ‘ll find time to test the new version on the server of development next week.
    Regarding your *Rant mode on* :=) …I understand what your are feeling. I think many people forget notify their answers via email for feedback.
    To be honest with you, so far, I have never clicked on works button just because I never think about it. Nevertheless I am trying to fix the problem with fix or relay bug.
    Maybe we need to be more grateful toward s developers. 

    Thank you for your great contribution and I hope you’ll keep working with us to maintain your plugin and bring us your ideas and improvements we could lead.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic