Giter Club home page Giter Club logo

open-graph-protocol-plugin-for-wordpress's Introduction

=== Plugin Name === Contributors: artlung,pathawks Donate link: http://joecrawford.com/plugin-donation Tags: metadata, opengraphprotocol, facebook Requires at least: 2.9 Tested up to: 5.5 Stable tag: 1.91

Adds Open Graph Protocol meta to the individual pages and posts of your WordPress Install.

== Description ==

Adds Open Graph Protocol meta tags to individual content pages of your WordPress install. Works in coordination with "Like" buttons and "share" inside Facebook and other consumers of OGP metadata.

== Installation ==

  1. Upload open-graph-protocol-tools/ to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. To add the "Like" module, use this code:
<?php
/**
 * Include this code on your theme for single blog posts (for example, in your single.php file)
 * or on your blogs main page to include a Facebook "Like" iframe
 */
if (function_exists('the_opengraphprotocoltools_like_code')):
   the_opengraphprotocoltools_like_code();
else:
	echo "<!-- opengraphprotocoltools is not activated -->";
endif;
?>

It would be best if in your theme you also added an attribute in the &lt;html&gt; tag, like this: &lt;html prefix="og: http://ogp.me/ns#"&gt;

== Frequently Asked Questions ==

= Is there a FAQ? =

I've gotten some bug reports via GitHub, you can report bugs or make comments there.

= For more information about Open Graph Protocol =

Visit Open Graph Protocol.

== Screenshots ==

None.

== Changelog ==

= 1 =

  • First version.

= 1.2 =

  • Changed instructions, fixes encoding errors for non-English content.

= 1.3 =

  • Improve issue with home vs front page

= 1.6 =

  • Improvements by pathawks to accommodate more types
  • Address double encoding issue with wptexturize modified values

= 1.7 =

  • Misc improvements I never enumerated and can't remember. Whoops.

= 1.8 =

  • WordPress 5 compatibility check!

= 1.9 =

  • Support for tag archive pages

= 1.91 =

  • WordPress 5.5 compatible

= 1.9.6 =

  • WordPress 6.4 compatible

open-graph-protocol-plugin-for-wordpress's People

Contributors

artlung avatar pathawks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

open-graph-protocol-plugin-for-wordpress's Issues

too many newlines

I prefer the output as generated by:

$out = array();

foreach ($data as $property => $content) {
    if ($content != '') {
        $out[] = get_opengraphprotocoltools_tag($property, $content);
    } else {
        $out[] = "<!--{$property} value was blank-->";
    }
}

return implode("\n", $out) . "\n";

Format Issue

Hi,

Your plugin works great, but i am having eon issue.

When i go to share a post which has '-' as part of the title it is not displaying properly.

Etc - i go to link a posts called - Mangakino Area School – Polyfest Calendar. Tokoroa 2012
But in Facebook it is linked as Mangakino Area School – Polyfest Calendar. Tokoroa 2012

So the '-' is being displayed as –

Any idea how to fix this issue, other than renaming all my posts.

Thanks in advance
Megan

Grabbing the images

You can use this:

function opengraphprotocoltools_image_url() {
global $post;

if( $images = get_children( 'post_type=attachment&post_mime_type=image&post_parent='.$post->ID ) )
{
    foreach( $images as $image )
    {
        $res = wp_get_attachment_image_src( $image->ID, 'medium' );
        return $res[ 0 ];
    }
}

return opengraphprotocoltools_image_url_default();

}

Apparently generating invalid HTML

W3C validator is reporting multiple errors on the home page and individual posts of a site using this plugin, in pairs of the kind:

Attribute property not allowed on element meta at this point.

Element meta is missing one or more of the following attributes: http-equiv, itemprop, name.

Accordingly, I've disabled the plugin, so cannot provide an example URL.

Error when writing the title

Hi Artlung.

I think the error is in the plugin when creating meta property="og:title" content="xx" / and meta property="og:site_name" content="xxx" . I tested a simple html manual inclusion of a facebook Ç and á and reads correctly.

I can read in http://www.calcots.es code to web

If you want to add an image to facebook and write correctly "Calçots de Valls from Calçot"

og:updated_time not set

For posts, og:updated_time should be a UNIX timestamp of when the post was last modified.
Note that comments should not affect this property.

fb:app_id

It seems fb:appid should be changed to fb:app_id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.