WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Get Custom Field Values

Use widgets, shortcodes, and/or template tags to easily retrieve and display custom field values for posts or pages.

I added the template tag to my template and the post has the custom field I'm asking for but I don't see anything about it on the page; what gives?

Did you echo the return value of the function, e.g. <?php echo c2c_get_custom('mood', 'My mood: '); ?>

Can I achieve all the functionality allowed by the six template functions using the widget?

Except for c2c_get_custom() (which is only available inside "the loop"), yes, by carefully setting the appropriate settings for the widget.

How do I configure the widget to match up with the template functions?

  • c2c_get_custom() : not achievable via the widget
  • c2c_get_current_custom() : set the "Post ID" field to 0, leave "Pick random value?" unchecked, and set other values as desired.
  • c2c_get_post_custom() : set the "Post ID" field to the ID of the post you want to reference and set other values as desired.
  • c2c_get_random_custom() : leave "Post ID" blank, check "Pick random value?", and set other values as desired.
  • c2c_get_random_post_custom() : set the "Post ID" field to the ID of the post you want to reference, check "Pick random value?", and set other values as desired.
  • c2c_get_recent_custom() : leave "Post ID" blank, leave "Pick random value?" unchecked, and set other values as desired.

I don't plan on using the shortcode builder when writing or editing a post or page, so how do I get rid of it?

When on the write or edit admin pages for a page or post, find the "Screen Options" link near the upper right-hand corner of the page. Clicking it slides down a panel of options. In the "Show on screen" section, uncheck the checkbox labeled "Get Custom Field Values - Shortcode". This must be done separately for posts and for pages if you want the shortcode builder disabled for both sections.

I don't see the shortcode builder; where is it?

The shortcode builder/wizard is available in the admin when writing or editing a page or post. On the edit/create page, it'll be a sidebar widget (in this context, also known as a metabox) labeled "Get User Custom Field Values - Shortcode". If you don't see it there (which may be the case since it is hidden by default), find the "Screen Options" link near the upper righthand corner of the page. Clicking it slides down a panel of options. In the "Show on screen" section, check the checkbox labeled "Get Custom Field Values - Shortcode". This must be done separately for posts and for pages if you want the shortcode builder enabled for both sections.

Can I move the shortcode builder box because it is way down at the bottom of the right sidebar when I create/edit posts?

Yes, any of the boxes on the page when creating/editing posts can be rearranged by dragging and dropping the box name. At the very top of the shortcode builder box the cursor will turn into a four-way array indicating you can click to drag that box. You can move it under the post content box, or higher up on the right side.

Why didn't the shortcode get inserted into the editor after I clicked the "Send shortcode to editor" button?

Sometimes you have to ensure the text editor has focus. Click within the text editor and make sure the cursor is positioned at the location you want the shortcode to be inserted. Then click the button and the shortcode should get inserted there.

Does this plugin include unit tests?

Yes.

Requires: 2.8 or higher
Compatible up to: 3.8.3
Last Updated: 2014-1-17
Downloads: 82,859

Ratings

4 stars
4.7 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
75,4,3
100,1,1
100,2,2
100,4,4
100,1,1
100,2,2
50,2,1
50,2,1
0,1,0
0,2,0 33,3,1
0,2,0
100,2,2
100,1,1
100,2,2
0,1,0
100,2,2