Adding target_blank and class to Types URL in PHP
-
Hi,
I am building a download table in PHP, where the user adds the URL in a WP Types custom field in the backend, and the table containing the download link and other information renders at the frontend.
I can do this successfully with the normal Types API. However, I wanted to add a target _blank to the link to open in a new tabl, and want to style the link to look like a button.
When I followed this Topic:
https://wp-types.com/forums/topic/using-target_blank-in-php-api-for-url-type-field/
I could not combine it with php. it will always give me errors.i tried this code:
echo "<a target='_blank' href="[types field="download-link" raw="true"][/types]"> Link Text </a>";
but gave me this error:Parse error: syntax error, unexpected 'field' (T_STRING), expecting ']' in /home/coptic/public_html/text/wp-content/plugins/coptic-treasures-functions/functionality-plugin.php on line 130
How to combine the WP Types url custom field with a target _blank and a class in php?
thanks
- The topic ‘Adding target_blank and class to Types URL in PHP’ is closed to new replies.