Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
[howto] Facebook Meta Tags
I put up a quick guide to adding Facebook Metas and keep them valid. There is a guide to this one TXPTips but seems a bit out of date and I couldn’t get parts of it to work. Heres what I came up with:
Last edited by CodeWalker (2013-09-19 19:03:54)
Offline
Re: [howto] Facebook Meta Tags
You could simplify that down to:
<txp:variable name="facebook"><txp:php>
echo intval(stripos($_SERVER['HTTP_USER_AGENT'], 'facebook') !== false);
</txp:php></txp:variable>
<txp:if_variable name="facebook" value="1">
<!-- Meta tags. -->
</txp:if_variable>
Which also avoids calling fragile template handler functions. Those functions might not be there in the future releases (e.g. yield()
is going to be gone in 4.6.0). There also are bunch of header and general conditional plugins that can perform similar checks.
Last edited by Gocom (2013-09-19 21:38:58)
Offline
Re: [howto] Facebook Meta Tags
Thanks Gocom. Im sure I tried something along those lines and it didn’t work. Im not great at PHP though! Ill test this out. I’ll update my blog post.
Offline
Pages: 1