CustomPress Formatting Custom Field Data

Using Custom Fields in CustomPress is there a way to make a default for each field? I would like to make a preset for how the data is formatted. Apparently there is support for pre-formatted fields but not what Im looking for. So I do not have to enter
<a href="mailto:contact@example.com">contact@example.com</a>
for each and every listing? Something like:
<a href="mailto:%field_data%">%field_data%</a>
so I just enter the email for each listing and it automatically shows up as a properly named mailto link?

How do I create this? Thanks!

  • Jose

    Hi there Nomad,

    Hope you are doing great today.

    Is there a section on the site similar to the codex on wordpress.org where I can read up on all the documentation for the plugins offered on this site and what the functions are etc.

    We have only usage documentation. There is no documentation for the code. You can always ask here in the forum and we will be glad to provide any information.

    With regard to your request, I'm not sure if I understand exactly what you need.
    I assume that you have a custom field for email address, and you want to display a mailto link using that value.

    In that case, you need to use something like this in your template:

    $email_address = do_shortcode('[ct id="ct_Email_text_1db2" property="value"]');
    <a href="mailto:<?php echo $email_address; ?>"><?php echo $email_address; ?></a>

    Of course, you will need to replace the shortcode with the 'Embed code' provided in the custom fields list.

    Please let me know if I understood it correctly and if the snippet works for you.

    Cheers,
    Jose