Toolset Types
[Plugin: Types - Custom Fields and Custom Post Types Management] How to embed into a php template (6 posts)

  1. drperil
    Posted 4 years ago #

    Hey guys,
    I love the plugin, and am considering buying views, I think my clients will love it.

    But before I dive in, can someone explain how to call a field in a page template?
    I've used Types to add a few custom fields, or taxonomies... Groups in Types I guess... to WP pages. The result is a fantastic set of WYSIWYG editors and image uploaders! but how do I put them in the template?

    I imagine it's something like getting custom fields (a la Codex) but to be honest I'm lost.
    For example, I've got an image field:
    field name: Banner Image
    field slug: bannerimg
    How would I call this in the page-section.php page template file?

    Thanks guys,
    ~ Dr. Peril


  2. drperil
    Posted 4 years ago #

    So I thought I should clarify, I saw the Functions section of the documentation, but
    types_render_field("my-numeric", $parameters)
    isn't really doing it, I keep getting warnings (luckily not errors), does anyone have an in--use example I can take a look at?
    Dr. Peril

  3. Amir Helzer
    Plugin Author

    Posted 4 years ago #

    Can you paste here what you're putting into $parameters and what warnings you're getting?

    When you say "isn't really doing it", what are you getting in the output?

  4. sykot
    Posted 4 years ago #

    Your plugin is awesome! but I don't want to use short-code like [types field="price"] so I've installed embedded ver. Now, how will I be able to call it from the theme page?

    Say I want to use it in index.php So, what should I write?
    <?php types_render_field("price", $parameters); ?> is not working..

    I'm really need your help.


  5. Amir Helzer
    Plugin Author

    Posted 4 years ago #

    The $parameters argument should be an array.

    You need to call something like:
    <?php types_render_field("price", array('raw'=>'false')); ?>

    The 'array' argument should include a list of all the arguments that you want to pass to the function. Have a look at this page for a complete list of all fields and their functions.


  6. sykot
    Posted 4 years ago #

    Thanks a million!!!

    http://wp-types.com/documentation/functions/ page is updated too :)

    thanks again

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Toolset Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic