Skip to content

Commit

Permalink
url work, is not singular add trailing per rel_canonical in wp. bump #46
Browse files Browse the repository at this point in the history
 and SERVER_NAME instead of HOST
  • Loading branch information
chuckreynolds committed Feb 11, 2015
1 parent b28385a commit df0002f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wp-facebook-ogp.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ function wpfbogp_build_head() {
echo '<meta property="fb:app_id" content="' . esc_attr( apply_filters( 'wpfbogp_app_id', $options['wpfbogp_app_id'] ) ) . '"/>' . "\n";
}

// do url stuff
if (is_home() || is_front_page() ) {
$wpfbogp_url = get_bloginfo( 'url' );
// do url stuff based on rel_canonical in wp
if ( !is_singular() ) {
$wpfbogp_url = trailingslashit( home_url() );
} else {
$wpfbogp_url = 'http' . (is_ssl() ? 's' : '') . "://".$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$wpfbogp_url = 'http' . (is_ssl() ? 's' : '') . "://".$_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
}
echo '<meta property="og:url" content="' . esc_url( apply_filters( 'wpfbogp_url', $wpfbogp_url ) ) . '"/>' . "\n";

Expand Down

0 comments on commit df0002f

Please sign in to comment.