Advanced Custom Field Widget

Advanced Custom Field Widget is a plugin for WordPress. Based on the original Custom Field Widget by Scott Wallick, and released under the GPL, ACFW allows you to drag content from custom fields attached to posts and pages and turn it into useful HTML for your WordPress powered sidebars.

The homepage for information about ACFW is now my wiki, but if you’ve got comments, then please leave them here on this page.

You can skip to the end and leave a response. Pinging is currently not allowed.

23 Comments

  • baron says:

    hi. Thanks for plugin

    perfect.

    Regards

  • Thanks for the feedback guys. Glad you like it.

    Scott: As I said in the readme… thanks for writing the original.

  • Hi,

    Thanks very much for the useful plugin. It’s great.

    I have discovered a problem though. The plugin seems to conflict with WordPress’ built in “Recent Posts” widget.

    I’m using WordPress 2.7 and v4.0 of your plugin, and I have configured the “primary custom field key” to be custom_sidebar_html1, and then I added a custom field (with a key of custom_sidebar_html1) to a specific page (about page).

    When the widget is placed above the recent post widget, it works as expected (the specific page displays the custom field’s value. However if I move the widget so it’s below the recent posts widget, then no content is displayed. The widget seems to be using the post id of the last post in the recent posts widget, so it never finds the custom field that is set for the page.

    Apart from this, everything seems to work.

    Do you have any idea how to fix this?

    Thanks!

    • Hi James,

      Thanks for the feedback.

      With regards to the problem you are experiencing, leave it with me… I’ll have a nosey through the code and see if I can come up with a fix.

    • Hi James,

      I’ve had a look at this problem over lunch, and I think I’ve got a fix. If you do a manual download of the development version, specifically ‘advanced-custom-field-widget.php’, it should be fine and operating as expected.

      I’ve tried it out on my slightly out of date development site on my laptop and it seems fine, so let me know how you get on with this fix and if it’s all good, I’ll tag up version 0.5.

  • will says:

    I posted this elsewhere here but the code might have mucked it up so I thought I’d put it in this thread shorter and sweeter.

    I am trying to inject the custom field as just one part of a link.

    EG somesite.com/abc/ThisIsTheCustomField.search

    The pretext is: blah blah blah somesite.com/abc/
    The posttext is: .search blah blah blah
    The custom field is: ThisIsTheCustomField

    But when I do that the resulting link is:

    somesite.com/abc/ThisIsTheCustomField.search

    which breaks the link.

    Any ideas on how to inject part of a link without the div messing t up?

    • will says:

      Bah! It stripped the code away this time. That resulting link should say:

      somesite.com/abc/ ThisIsTheCustomField .search

      Here’s hoping the scode spaced out breaks it up and it won’t get stripped.

      • will says:

        And it was, again.
        That resulting link should say:

        somesite.com/abc/ ( div class = ‘ advancecustomvalue ‘ ) ThisIsTheCustomField ( / div ) .search

        with all brackets naturally being ><

  • Hi Will,

    What you want to do ties in nicely with a change I’ve been pondering for a little while, so I’ll see what I can do within the next day or so if you can bear with me :-)

  • Bill W says:

    I think I like this plugin …. seems complicated, but that’s good in this case.

    Here’s a problem: when trying to pull the url for an image out of a custom field, wrapping it using pre and post text so the image will appear and not just output the url, this is the output to the page:

    looks like it’s trying to add some class div before and after my pre and post … ideas?

    Also, the other thing I would like to do is have this image display, but also make that a link to the post it comes from … ideas how I can do that?

    thanks for your work!

    • Bill W says:

      i hate this no code in comments!

      okay, hopefully this will work and you’ll get the idea …

      %3Cdiv%20class=%27advcustomvalue%27%3E%0Ahttp://www.cchange.net/wp-content/uploads/2009/04/johnelkington1-150%C3%97150.jpg%0A%3C/div%3E”

      please email me if this code doesn’t appear.

  • Hey Will,

    Your plug-in may be a miracle for me, but my little brain has trouble figuring it out. My site is intent on offering different organizations a place to post their localized news and calendar info on an individualized page. The news comes by way of RSS feed and the calendar by way of icalendar.

    Problem: I can’t use the widgets obviously, because I get the same content on each page. When I embed my individualized content in the page/post directly, without the formating aid of a widgetized area, it doesn’t show up nice and neat as in a widget, but rather haphazardly across the page. I have been trying to figure out how to create custom fields for this purpose, but the learning curve is too high for me. Can this plug-in make the process easier?

    • Firstup… it’s not Will’s plugin, it’s mine… but that minor error aside, I’m not quite sure what you want to do.

      The Advanced Custom Field Widget is for displaying the content of custom fields in a sidebar widget. If you take a look at my site, the Amazon side bar is the ACFW loading content from pages where I’ve reviewed something. It doesn’t pump data into the custom fields, it just makes displaying whats there fairly simple. If you can provide a bit more information and possibly an example page or something, then I may be able to give you a better answer.

  • So sorry for the name mix-up. I got excited.

    Despite the best of intentions, I’m not smart enough to get this stuff. If you look at http://www.mpoweredparent.com, you’ll see a newsfeed at right sidebar. “Drunk Driving in the News”. It displays nice and pretty because it’s in a widget. Now check out http://www.mpoweredparent.com/rpa . That is a test page that I have been thumping away at for over a week now. It displays an individual rss feed that was custom selected for that page. The problem is that in order to select a custom feed for that page, I have to embed the feed into the post, rather than simply drop it into a widget. As a result, formatting goes out the window, and the feed displays across the entire page.

    My goal is for the AthenaOfDelphi Organization to be able to have their own page/post, with a localized news feed, and secondly, their own icalendar feed display in a nice neat “widget-like” area of the page. Ultimately, I’ll have dozens of these pages, and would like them to look uniform, but for the customized content. Using widgets, I would be stuck with the same feed and icalendar content on each page. Thanks again for your time and wisdom. -T

  • Yanik says:

    Hello AthenaOfDelphi,

    First i want to thank you for this great plugin which is so wonderfully close to what I need for my site.
    I was wondering if there was a quick and dirty way to have 3 different calls per page such as:
    custom field ‘amazon-linkto’ with value to 204
    custom field ‘amazon-linkto’ with value to 206
    custom field ‘amazon-linkto’ with value to 208
    And have the 3 displayed in the same sidebar at the same time?

    thanks for any further help you may provide.

    Cheers
    Yanik

    • Hi Yanik,

      At the moment, no because the widgets will all pick up the first instance of the ‘amazon-linkto’ field so they’d all point to the same page.

      However, thats not to say that it can’t do it. I’ve sent you a mail to discuss further.

  • Will says:

    Looks like something broke. I just upgraded from WP 2.86 where everything was just fine to WP2.9. This required a database dump and upgrade to mysql5. Got everything running but the ACFW now shows every widget whether a custom field was used or not (ie if no cf used then it shows a blank widget). Any ideas if this a WP2.9 issue or something I can correct in the database?

    • Hi Will,

      I’ve just released version 0.82 of the widget, which should fix the problem you’re having. It appears to have been caused by a minor change in functionality (or a bug fix) in one of the WordPress functions I was using to retrieve the custom field data. When I upgraded the development copy of my blog to WP 2.9, I got the problem you’re experiencing… widget version 0.82 has fixed it, so give it a try and let me know how you get on.

      Athena

  • karin says:

    Hi,

    I just found your plugin. Hoped it would work on my page, but it doesn’t. The page I want to use it for is not a regular WordPress page, but it’s a page with three blocks with the loop, each showing the lastest post of a certain category. The ACFW are working perfecty on a normale page, but not on this page. The sidebar is okay. there is one normal textwidget and that is showing, but the CF widgets aren’t. Is there a way to show the widgets on a page with multiple loops?

    • karin says:

      Got my friend making some changes to the code. It’s working now.

      • I’m not sure myself as I’ve only ever had one loop… but clearly you’re friend has made it work. If you could send me the modified code, I can look at including the changes in a later release which may of course help other people out as well.

        And another thing… where’s your site so I can have a look at it in situ? :-)

Leave a Reply