简体   繁体   中英

changing title of page doesn't work with facebook meta tags

I'm trying to set my meta tags for facebook like, but I have like button on changing page which means that title will be always different. My meta tag look like:

<meta property="og:title" content="<?php echo $listing['Listing']['title']?>" />

or whatever code I put there. It shows my title at debuger like:

<?php echo $listing['Listing']['title']?>

Simply sad, what's in inverted comas, that's title. Why? why it doesn't accpet that php code?

What file did you post the code into? It looks like it's not where it's supposed to be... I'd advise putting the tag into your template (/templates/yourtemplate/index.php)

Alternatively there's alot of extensions that can handle this for you: http://extensions.joomla.org/search?q=facebook+open+graph

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM