This version of the Custom Field Images Plugin adds the CFI Loop widget. By default, it displays the 5 most recent custom field images, linked to their respective posts. If you’re familiar with the WordPress Loop, you can customize which images to show by filling the Query String field.

If you don’t like using widgets, you can use the new template tag cfi_loop() directly in your theme files. You can find out more about it in the readme file.

PHP5 is required.

Comments (66)

  • Separatista says:

    Wordpress 2.7, PHP 5.2

    Fatal error: Class ’scbOptionsPage’ not found in /var/www/web5/example.com/example.com/wp-content/plugins/custom-field-images/admin.php on line 60

    • scribu says:

      Until I release a patch, you can replace

      $table .= scbOptionsPage::form_row($row, $options, false);

      with

      $table .= scbOptionsPage_05::form_row($row, $options, false);
      • Separatista says:

        Hi, it works, thank you. But “Insert CFI” button still does not work in IE7 :-( Could you please add support for this browser? Thank you very much… Also design in Wordpress 2.7 is not the best (radio buttons are in the centre of screen, etc.)

  • Justin says:

    I don’t get an error when I upgrade, but a post / page doesn’t display correctly within wp-admin. It only shows the title of Custom Field Image and then nothing, not even loading the standard WP options.

  • Majin says:

    Hi, thank you for your plugin, I’ve spent a lot of time trying to find a way to do what CFI does, it’s perfect for what I need. But since I updated to 1.8, my website does not load on IE 7, it starts loading but then I get an “operation cancelled” error. Do you know what it could be?

    • scribu says:

      Most of the processing is done in PHP, on the server side, so that means it doesn’t matter what browser you’re using. The plugin loads some javascript only on the Write Post and Write Page panels, so that is the only area where problems may arrise.

      Try disabling the (Insert CFI) button from CFI Settings and see what happens.

  • Dragon says:

    This is a great plug-in. Thank you very much for your time and effort. I have a request. Would it be possible to add the ability to browse for and upload the image to place in the post? Thanks again.

    • scribu says:

      You mean to display the (Insert CFI) button just after uploading an image, right? I’m afraid that will have to wait untill WP 2.8 is out.

      (I need the live() event in jQuery 1.3 and WP 2.7 ships with jQuery 1.2)

  • Separatista says:

    Hello, there is problem with encoding.
    For example my Alt. text is “tísňová”, but after saving post (not only after inserting through CFI button – it works well, but after saving post) there is “tísÅ�ová” and after next saving there other stranger characters. Could you, please, repair it?

  • Separatista says:

    Hello, is it possible to add support to NextGEN Gallery? It would be very helpfull when “Insert CFI” button could appear also when using this gallery. When Gallery is active you can see new tab in “Add media” window and you can select picture into post from this gallery, but it is not possible to insert CFI. Thank you for your help…

  • TRAIAN says:

    CAND INTRA CINEVA PE POST VREAU SA NU MAI FIE IMAGINEA AFISATA , CUM FAC? MS

  • WP coder says:

    Hi, excellent plugin, i moved a site to another server recently and came across this error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /site/folder/structure/here/wp-content/plugins/custom-field-images/main.php on line 29

    Any ideas, i dont want to change plugin because this works so well.

    Thanks for your hard work, any answers would be much appreciated.

  • 咖啡与烟 says:

    thank you!
    but..

    Warning: sprintf() [function.sprintf]: Too few arguments in /home/pinkpark/public_html/design/wp-content/plugins/custom-field-images/main.php on line 145

    wordpress2.7+
    what’s wrong?

  • 咖啡与烟 says:

    Extra link attributes?here?
    I tried, it can’t work.
    it can work at my local test.

    • 咖啡与烟 says:

      When the picture there is no link, it is normal,just a pic.

    • scribu says:

      Where exactly are you getting that warning? Iit’s just a warning by the way – you can simply hide it by adding this line in your wp-config.php:
      ini_set('display_errors', 0);code>

  • elvis says:

    Hi, thanks for your plugin it is exactly what i need.
    I am however getting an error.
    When i go back to edit a post that i have added a custom field image to, instead of the ‘custom field’ text fields, i get:
    “Fatal error: Call to undefined method boxCFI::check_names() in E:\domains\t\domain.com\user\htdocs\testblog\wp-content\plugins\custom-field-images\inc\scbForms.php on line 39″

    when i do a new post, the entry fields are there as normal.
    I have PHP Version 5.2.6, but it is on a windows NT server, if that makes any difference.

    Do you have any idea what the problem could be?

    • scribu says:

      Hi, I’ve been able to reproduce your error and I will release a fix soon. Thanks for letting me know.

  • elvis says:

    Hi, thanks. I installed the latest version last week, and then updated it this morning, so i think it was just in todays update.

  • daniel n says:

    Hi I did update to version 1.8.3.1 but I still got the error:
    Fatal error: Call to undefined method boxCFI::check_names() in /wp-content/plugins/cft/inc/scbForms.php on line 38

    But only when I try to edit an existing post. For the new posts it works.
    Thanks

  • elvis says:

    Hi, thanks for that fix, however i am getting a problem that whenever i edit a post, it loses its custom image.

  • elvis says:

    Hi, it is happening with full or quick edit. any change to the post, even adding a category, and the post no longer has the custom image.

  • elvis says:

    Hi again!
    I want to show a ‘default’ image if there is no custom image uploaded.
    Is there a way to check if the cfi exists for a post?

    thanks

  • Masud Ibn Afjal says:

    Hi ,I installed custom-field-image plugin version 1.8.3.2
    My problem is ” images is not display in my page/post “.
    but link or alt text are display
    and in admin panel any button is not found

    • scribu says:

      Are you sure you didn’t enter a wrong URL for the image?

      As for the admin panel, you mean the “Insert CFI” button?

      What version of WP are you using?

  • Masud Ibn Afjal says:

    I dont see any button

  • Masud Ibn Afjal says:

    please give me a solution
    or a guideline to using this plugin

  • Masud Ibn Afjal says:

    Sir now picture is display but its not re sized its display its original size which is uploaded.

    And how I set the images in my choosing position because it show its default position

    • scribu says:

      This plugin doesn’t do any resizing. You have to set the Image URL to the thumb. This is done automatically with the (Insert CFI) button.

      Check the FAQ for the position issue.

  • elvis says:

    Hi there,
    I am getting a problem with my wordtube plugin if Custom Field Images is installed.
    The view counter in wordtube stops working if CFI is activated.
    When a video is played, wordtube calls “wp-load”, normally it returns a view counter number but when CFI is on, i get the error:
    Fatal error: Class ‘widgetCFI’ not found in E:\domainname.com\user\htdocs\site\wp-content
    \plugins\custom-field-images\main.php
    on line 170
    any ideas what the problem is?
    thanks!

  • elvis says:

    Hi, i am not using the widget! just
    custom_field_image() ;
    in my template.

    which was working fine. it was the wordtube counter that was giving the error.

    somehow wordtube loading the wp file “wp-load” called something in CFI and gave that error.

    i tried switching off CFI plugin and wordtube worked fine.

    i have commented the following lines in CFI main.php:
    //require_once(‘widget.php’);
    //new widgetCFI(__FILE__);

    and my custom images still show fine and wordtube is working.

    • scribu says:

      I think I know what the problem was. You have to replace

      require_once('widget.php');

      with

      require_once(dirname(__FILE__) . 'widget.php');
  • Separatista says:

    Hello, I use CFI together with Auto Thickbox plugin. When I check “Content” in CFI settings, then thickbox works. But when I use custom_field_image() and uncheck “Content”, then thickbox does not work.

    When I use special query_posts with content (on special Wordpress page), CFI does not work and I have to use custom_field_image().

    Also support CFI button for NextGen Gallery would be very helpfull…

    • scribu says:

      From what I have read, the Auto Thickbox plugin only works on images inside the post content. When you check “Content” in the CFI settings, the image is actually added to the post content using the_content filter.

      So, in your custom query, you should try using the_content() or the_excerpt() if you’re not doing this already. CFI should work in this case, without custom_field_image().

      BTW, the next update to this plugin will be after WordPress 2.8 comes out.

      • Separatista says:

        Auto Thickbox works only when I check Content in CFI settings. But I need to use custom_field_image() to display pictures in special place above content. But when using this function, Auto Thickbox does not work (probably because of filtering only post_content and not images which are not included in post_content). It would be very helpfull to add support for Thickbox into CFI plugin. Or is there any other solution to display CFI pictures not included in post_content with Thickbox?

        And another problem – when I changed category for some posts with Quick Edit, CFI data were deleted from post.

        • scribu says:

          In the “Extra link attributes” field, you could add class=”thickbox”. This means that all images will have to be linked.

          As for Quick Edit, thanks for mentioning it. It will be fixed in the next release.

  • Georg says:

    Hi scribu,

    This seems to be a very nice plugin that I will test asap.

    As you know, I am fond of translatable plugins. Do you have any plans to gettext it? Or could you be persuaded to have such plans? ;-)

    As you know, we are eager to translate! :-)

  • Separatista says:

    Hi, probably bug: When I upload .png picture into post gallery and then insert it with “Insert CFI” button into post, .png thumbnail is added. But Wordpress 2.7.1 creates from original .png file thumbnails in format .jpg. Thank you for your help…

    Is it possible te gettext this plugin, it is better for our users…

  • elvis says:

    Hiya
    i’ve just freshly installed WP 2.8 and CFI 1.8.3.3 but I don’t get the “insert CFI” button appearing in the image upload/insert window.
    no other plugins installed.
    any ideas?
    thanks
    elvis

  • gOk says:

    Sup ppl, I made a fix to the button problem that weren’t showing after uploading the image.
    It’s far away from being a nice solution, but, while 2.8 isn’t out (with the jQuery.live()/1.3), that will do the job.

    on “/wp-admin/includes/media.php” | line 1139 | add:

    (<a href="#" class="insert-cfi" style="color:#006505;" rel="nofollow">Insert CFI</a>)

    on “/wp-content/plugins/custom-field-images/inc/insert.js” | lines 39 to 41 | comment out this code:

    frame.find('.media-item :submit').each(function() {
      $(this).after(' (<a href="#" class="insert-cfi" style="color:#006505;" rel="nofollow">Insert CFI</a>)');
    });

    As I said, it’s not the best way and I don’t think that a plugin is allowed to change “media.php”, but, it solves the problem :)

  • scribu says:

    What you’re proposing is hardcoding the button in a WordPress core file.

    It will work, of course, but you’ll have to do it every time you update the plugin or WP.

  • gOk says:

    Yeah yeah, harcoding. But it’ll work till 2.8. I just focused the solution here… IMO you should post this tip on somewhere… and sorry for the triple post… if you want, delete that and I’ll re-post it on pastebin. ;) cheers… hey, nice plugin ^^

  • scribu says:

    I’m glad you like it and thanks for contributing. :)

    No need to repost it – I think it’s readable enough.