WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
How to embed into a php template (6 posts)

  1. drperil
    Member
    Posted 2 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

    http://wordpress.org/extend/plugins/types/

  2. drperil
    Member
    Posted 2 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?
    Thanks,
    Dr. Peril

  3. AmirHelzer
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 2 years ago #

    Hi,
    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.

    Thanks

  5. AmirHelzer
    Member
    Plugin Author

    Posted 2 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.

    http://wp-types.com/documentation/functions/

  6. sykot
    Member
    Posted 2 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

About this Topic

Tags