简体   繁体   中英

FAcebook include php script instead of php output

I'm using Wordpress 3.8, and i have a page with insert php plugin. The page works correctly, when it's called from the main site. Inside the wordpress page there is written:

[insert_php]
require("{$_SERVER['DOCUMENT_ROOT']}/podcast_manager.php");
[/insert_php]

But when I post the link on facebook, it outputs this:

http://snag.gy/3MCb2.jpg

Outputting php code, instead of running it!

Really I do not know why !

What is happening is that the php code is in the body of the Wordpress post/page. That creates a description (static text) that FB then reads, sort of like Facebook Open Graph .

To try to see if that is the problem, try creating a custom description by using a SEO plugin. Otherwise the PHP code is executing fine, it is just a description issue that FB reads from the header.

EDIT

View source of your post/page and see if the <meta name="description" content=""> holds that php string in it.

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