How can I get custom fields in wordpress?

How can I insert information from custom fields as shortcodes in wordpress?

  • In creating a restaurant blog and I would like to be able to create custom fields for "map" "telephone" "address" etc, and I would like to be able to insert it into the post using shortcodes, I´m not sure how to accomplish this

  • Answer:

    I think you should follow a different approach. If you are saving the information as post custom fields or post meta, then on your template page, inside the loop, you can just get the post meta and display it. I don't think there is a shortcode that will work with post specific custom meta. Even if you want such a shortcode, you'll have to write it yourself. Using post meta calls is an easier approach.

Rutwick Gangurde at Quora Visit the source

Was this solution helpful to you?

Other answers

This what you need? // Use shortcode in a PHP file (outside the post editor). echo do_shortcode('[gallery]'); http://codex.wordpress.org/Function_Reference/do_shortcode

Ciprian Cirstea

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.