Get Custom Field Values

Get Custom Field Values

Wordpress plugin

Install on Wordpress

App Details

This plugin provides a powerful widget, shortcode (with shortcode builder tool), and template tags for easily retrieving and displaying custom field values for posts or pages.

The power of custom fields gives this plugin the potential to be dozens of plugins all rolled into one.

This plugin allows you to harness the power of custom fields/meta data. Use the “Get Custom Field” widget, the [custom_field] shortcode (which has a post editor sidebar widget to help you build the shortcode), or one of six template tags to retrieve and display custom fields. Find a custom field for the current post, a specified post, a recent post, or randomly. And for the custom field values found by the plugin, you may optionally specify text or HTML to appear before and after the results. If nothing is found, then nothing is display (unless you define text to appear when no results are found). If multiple results are found, only the first will be displayed unless you specify a string to be used to join the results together (such as “,”), in which case all will be returned. Visit the Examples section to see how this plugin can be cast in dozens of different ways.

There are six template tags provided by this plugin. Here they are, with an explanation of when they are appropriate for use:

  • c2c_get_custom() : Use this inside “the loop” to retrieve a custom field value for a post
  • c2c_get_current_custom() : This is only available on the permalink post template (single.php) and page template (page.php). Can be used inside or outside “the loop”. Useful for using custom field to define text you want to include on a post or page’s header, footer, or sidebar.
  • c2c_get_post_custom() : Useful when you know the ID of the post whose custom field value you want.
  • c2c_get_random_custom() : Retrieve the value of a random instance of the specified custom field key, as long as the field is associated with a published posted, non-passworded post (you can modify a setting in the plugin file to search passworded posts as well).
  • c2c_get_random_post_custom() : Retrieves the value of random custom field(s) from a post when you know the ID of the post you’re interested in.
  • c2c_get_recent_custom() : Retrieves the most recent (according to the associated post’s publish date) value of the specified custom field.

You can filter the custom field values that the plugin would display. Add filters for ‘the_meta‘ to filter custom field data (see the end of the code file for commented out samples you may wish to include). You can also add per-meta filters by hooking ‘the_meta_$sanitized_field‘. $sanitized_field is a clean version of the value of $field where everything but alphanumeric and underscore characters have been removed. So to filter the value of the “Related Posts” custom field, you would need to add a filter for ‘the_meta_RelatedPosts‘.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Developer Documentation

Developer documentation can be found in DEVELOPER-DOCS.md. That documentation covers the numerous template tags, hooks, and shortcode provided by the plugin.

As an overview, these are the template tags provided the plugin:

  • c2c_get_custom() : Template tag for use inside “the loop” and applies to the currently listed post.
  • c2c_get_current_custom() : Template tag for use on permalink (aka single) page templates for posts and pages.
  • c2c_get_post_custom() : Template tag for use when you know the ID of the post you’re interested in.
  • c2c_get_random_custom() : Template tag for use to retrieve a random custom field value.
  • c2c_get_random_post_custom() : Template tag for use to retrieve random custom field value(s) from a post when you know the ID of the post you’re interested in.
  • c2c_get_recent_custom() : Template tag for use outside “the loop” and applies for custom fields regardless of post.

These are the hooks provided by the plugin:

  • c2c_get_custom_field_values_shortcode : Filter to customize the name of the plugin’s shortcode.
  • c2c_get_custom_field_values_post_types : Filter to customize the post types that should support the shortcode builder metabox.
  • get_custom_field_values/can_author_use_shortcodes : Filter to customize if post author can make use of the ‘custom_field’ shortcode.
  • get_custom_field_values/show_metabox : Filter to customize if the shortcode builder metabox is shown.

The shortcode provided is [custom-field], which has a number of attributes to customize its behavior and output.

Pricing

Starting from $0 per month.

Check Out the Glassdoor Reviews Widget

By Common Ninja

Glassdoor ReviewsTry For Free!

App Info

Rating

Reviewers

4 reviews

Tags

custom fields
meta
shortcode
widget
widgets

Developed By

Scott Reilly

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Maps

Maps plugins for Wordpress

Translation

Translation plugins for Wordpress

Chat

Chat plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Contact

Contact plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Forms

Forms plugins for Wordpress

Comments

Comments plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Comments

Comments plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Video Player

Video Player plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Security

Security plugins for Wordpress

Ads

Ads plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Membership

Membership plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Glassdoor Reviews for Wordpress logo

Glassdoor Reviews

Show Glassdoor reviews to highlight employee feedback, strengthen employer brand, and help candidates trust your company.

Age Gate for Wordpress logo

Age Gate

Use an age verification popup to validate visitor age, meet regulatory requirements, and ensure only eligible users access restricted content.

YouTube Carousel for Wordpress logo

YouTube Carousel

Show YouTube videos with a YouTube carousel that displays clips in a smooth, customizable layout to boost visibility and keep visitors engaged.

App Store Reviews for Wordpress logo

App Store Reviews

Show Apple App Store reviews to build trust, strengthen credibility, and help visitors make confident download decisions that support app growth.

Scratch Card for Wordpress logo

Scratch Card

Add an interactive scratch card to engage users, reveal offers, and support lead capture through gamified participation.

Strip Button for Wordpress logo

Strip Button

Add a Stripe Button to your website to give customers a fast, trusted checkout experience.

Charts & Graphs for Wordpress logo

Charts & Graphs

Add charts and graphs to your site to present data clearly, help visitors understand insights faster, and support more confident decision making.

Countdown to Download for Wordpress logo

Countdown to Download

Use a countdown to download widget that reveals files after the timer ends, builds anticipation, and guides visitors toward higher engagement.

Logo Slider for Wordpress logo

Logo Slider

Add a logo slider to your site to showcase clients and partners, strengthen brand credibility, and build trust with new visitors.

All In One Chat for Wordpress logo

All In One Chat

Add a unified chat tool to your site that connects users via WhatsApp, Messenger, Telegram, or email for seamless support.

Slide-In Panel for Wordpress logo

Slide-In Panel

Slide in panel that appears from the top or bottom to highlight offers, capture attention, and guide visitors toward more conversions.

AliExpress Reviews for Wordpress logo

AliExpress Reviews

Show AliExpress reviews to build trust, improve credibility, and help visitors make confident purchase decisions that support higher sales.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms