Forums

Get Custom Field Values
About sidebar widget (4 posts)

  1. mokona84
    Member
    Posted 4 months ago #

    I'm trying to figure out how to set up the widget to have my custom fields appear in the sidebar. I guess I can only retrieve a single custom field, so if I want to have 3 custom fields in my sidebar I have to load the widget 3 times, right?

    http://wordpress.org/extend/plugins/get-custom-field-values/

  2. coffee2code
    WordPress & Plugin Dev
    Posted 4 months ago #

    Yes, the widget only retrieves a custom field according to a specific field/key. That field can appear multiple times for a post, or in multiple posts. It currently does not support retrieving multiple custom field keys in a single widget or request.

    Could you provide an example use case where you want to get the values for multiple custom field keys in a single widget?

  3. mokona84
    Member
    Posted 4 months ago #

    Well, in my case I use custom field to show information about songs, like author, year etc.
    I'v always used this same plugin to display information within the post page, now I wanted to try display them in a sidebar.

  4. coffee2code
    WordPress & Plugin Dev
    Posted 4 months ago #

    Unfortunately the widget does not currently facilitate being as freeform with the output of multiple custom fields for a post as is possible when using the template tags within template files (as that's what you seem to be saying you currently do).

    If you're already using the template tags within a post/page template, you can also use them in the sidebar. There are variations of get_custom(), such as get_current_custom() that work in the sidebar template.

    But I do understand your use case though. I have plans for additional functionality that will make doing what you want to do quite easy. No time estimate on when it'll be ready though. Until then it's either the template tag approach, or multiple widgets.

Reply

You must log in to post.

About this Plugin

About this Topic