I am trying to integrate opengraph on this website http://www.lsenow.com .
The person who wrote the topic used hard-coded mysql instead of the functions already provided by WordPress to retrieve data from the database. I do not know how relevant this is. I just did not see it, especially since it is not necessary.
I get this message when setting this URL (http://www.lsenow.com/?event=campus-tours-2) through the debugger:
The object at the URL "http://www.lsenow.com/" of the type "event" is invalid because the set value "for the property" og: image: url "may not be parsed as the type 'url'.
The facebook debugger gives me this regarding the url:
Scrape Information Response Code: 200 Fetched URL: http://www.lsenow.com/?event=campus-tours-2 Canonical URL: http://www.lsenow.com/ Redirect Path Original: http://www.lsenow.com/?event=campus-tours-2 301: http://www.lsenow.com/
I tried many things, I tried:
- <meta property = "og: url" content = "<? php $ url =" http: // ". $ _ SERVER ['HTTP_HOST']. $ _ SERVER ['REQUEST_URI']; echo $ url ;?>" / ">
- <meta property = "og: url" content = "<? php the_permalink ()?>
- Adding <link rel = "canonical" href = "<? Php $ url =" http: // ". $ _ SERVER ['HTTP_HOST']. $ _ SERVER ['REQUEST_URI']; echo $ url ;?>" / ">
- <meta property = "og: url" content = "http://www.lsenow.com/?event= <? php echo $ _GET ['event'] ;?>" / ">
Does anyone have a solution to this problem. I feel like adding code.
here is what i have:
<link rel="canonical" href="<?php $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; echo $url; ?>"/> <meta property="og:url" content="http://www.lsenow.com/?event=<?php echo $_GET['event'];?>" /> <meta property="og:title" content="<?php the_title(); ?>" /> <meta property="og:type" content="events"/> <meta property="og:image" content="http://placehold.it/300x300"/> <meta property="og:site_name" content="<?php bloginfo('name');?>"/> <meta property="og:description" content="<?php the_excerpt();?>"/> <meta property="fb:app_id" content="151709234971178" />
source share