• Hello,

    To single.php i added custom fields, (made by Toolset).

    the code is below

    <?php if( types_render_field(‘model’) ): ?>
    <h5 class=”cena”>Model: <b><?php echo types_render_field(“model”); ?></b>
    </h5>
    <?php endif; ?>
    I wonder, how to show this field in pdf file.
    I was try few options, but its not showing.

    On the website I’m using DK PDF plugin also (for pdf generation).
    Can you advice, how should looks code If I want add this custom field to dkpdf-index.php ? (dkpdf-index.php in a tamplate of PDF)

    Thanks for advice

Viewing 1 replies (of 1 total)
  • Anonymous User 14808221

    (@anonymized-14808221)

    types_render_field() is a function intended for the PHP Templates of your Theme.
    With it, you can get the values of the Fields registered with Toolset Types.

    Let’s say you have a single Line field “My Line”.
    Then you populate several Posts, so the Field “My Line” has a value (value 1, value 2, etc).
    Then, you would get the value of those fields by adding $value = types_render_field( "my-line", array( ) );

    To display it, you need to echo that value.

    Now, I am not sure how that plugin generates it’s PDF’s but I am quite sure, it’s not echoed.
    Instead, it probably puts the values you intend to show on the PDF into a variable and later does some custom code magic with it, so to print it to a generated PDF.

    We cannot assist with this here, you would need to ask the support of the plugin, how to add custom data to the PDF’s, such as Custom Meta Fields (or native WordPress Custom Fields, which act the same).

    I need to give you a heads up about Toolset Types free version, please read more here.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom field in PDF’ is closed to new replies.