Use php in post template
-
Hi
Can I use php in post template?
I need to get ACF data into the template. I have custom post type and using WPUF and ACF. From this custom post type data I want to create a clean html-template with this custom post data.
Any suggestions?
Best regards
Viktor
-
Hello,
the current version of the plugin simply gets HTML out of the database and outputs it to the browser after the PHP (preprocessor) has done its job, so you can’t really put PHP in there (well you can but it won’t be processed, but outputted raw).The new version that is in the making has the router part separated from the rest of functionalities, and implements hooks for developers, so it will be easier to write an addon that will do what you want.
As for the current version, you can either edit wp-custom-html-pages.php to alter the WPCHTMLP_permalink_handler function which is the router part, or perhaps write addon(s) for WPUF/ACF instead, implementing a simple custom router like that function does. Either way you would have to write code, hire some developer or request a quote from me. Good luck!
Hello,
Thank you, and thx for good response! I think it go faster if you can help me with this. Can you please send me a quote on my mail [email protected]. I add my HTML template in the end that just need some info from ACF.
I have all groundcode to generate out the info from ACF so this I also can use shortcode with.
Maby its possible to use PHP-snippets/shortcode plugin in your plugin?
Im going to check this what you write and test to do this tomorrow. Have to get little sleep first. ??
Best Regards Viktor
HTML Email signature I need ACF data to:
<!DOCTYPE html> <html lang="sv-SE"> <meta charset="UTF-8"> <title>Title</title> <br><br> <div class="ecocard-signature" style="margin: 5px auto; padding:10px;"> <table style="font-family: 'Helvetica Neue', Helvetica, Arial,sans-serif;" border="0" cellpadding="0" cellspacing="0" width="650"> <tbody> <tr> <td width="70" style="padding-right: 15px;"><img src="3on-logo.png" alt="logo" max-height="150px" width="150" style="padding: 2px; border-radius: 8%; border: solid 1px #e4e4dc; "></td> <td style="padding-left:20px; border-left: solid 2px #cecece;" width="400"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td style="font-size:12px; color:#8bc34a; font-weight:bold;text-transform:uppercase;">Firstname Lastname <span style="font-size:14px;color:#4b5662; text-transform:lowercase;">ceo</span></td> </tr> <tr> <td style="font-size:14px; line-height:18px;"><span style="color:#000000;font-weight: 600;text-transform:uppercase;">c</span> Company.</td> </tr> <tr> <td style="font-size:14px; line-height:18px; padding: 10px 0px 10px 0px;"><a href="tel:+46733729898" style="padding: 0px 10px 0px 10px;"><img alt="Phone" src="ecocard-phone.png" height="38" width="38"></a> <a href="sms:+46733729898" style="padding: 0px 10px 0px 0px;"><img alt="Message" src="ecocard-direct-message.png" height="38" width="38"></a> <a href="https://url-to-card/" style="padding: 0px 10px 10px 0px;"><img alt="url.card" src="ecocard-io-my-business-card.png" height="38" width="38"></a> <a href="https://url.se" style="padding: 10px 0px 10px 0px;"><img alt="google+" src="website-ecocard-link.png" height="38" width="38"></a></td> </tr> <tr> <td style="font-size:14px; line-height:18px;"><span style="color:#000000;font-weight: 600;text-transform:uppercase;">t </span><a href="tel:+46733729898" style="color:#080808;text-decoration:none;">+46123123 </a> | <span style="color:#000000;font-weight: 600;text-transform:uppercase;">p </span><a href="tel:+46123" style="color:#080808;text-decoration:none;"> +46 123 20 150</a></td> </tr> <tr> <td style="font-size:14px;line-height:18px;"><span style="color:#000000;font-weight: 600;">E </span><a href="mailto:[email protected]" style="color:#080808; text-decoration:none;">[email protected]</a> | <span style="color:#000000;font-weight: 600;text-transform:uppercase;">w </span><a href="https://3on.se/" style="color:#080808; text-decoration:none;">3on.se</a></td> </tr> <tr> <td style="font-size:14px;line-height:18px;"><span style="color:#666;font-weight: 600;">View </span><a href="https://url#/" style="color:#999; text-decoration:none;">my online business card</a></td> </tr> </tbody> </table> </td> <td style="padding-left:20px; border-left: solid 2px #cecece;" width="180"><br> <img src="image.jpg" alt="logo" height="150" width="150px" style="padding: 2px; border-radius: 50%; border: solid 1px #e4e4dc; "> </td> </tr> <tr> <td colspan="3" style="padding-top:10px;" width="470"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td style="text-align: left;padding-left: 180px;" width="100%"> <a href="https://download-url-for.vcf" style="padding: 2px;"><button style="background-color: white; color: black; padding: 5px 22px; text-align: center; text-decoration: none; display: inline-block; font-size: 10px; margin: 4px 2px; cursor: pointer; border: 2px solid #e7e7e7;">Get my VCARD</button></a> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div> </html>
- The topic ‘Use php in post template’ is closed to new replies.