Quantcast
Channel: WordPress.org Forums » [Yoast SEO - Advanced SEO with real-time guidance and built-in AI] Support
Viewing all articles
Browse latest Browse all 42467

deas0815 on "[Plugin: WordPress SEO by Yoast] WP SEO 1.4.4 Homepage Opengraph Bugfixes"

$
0
0

The options og_frontpage_image and og_frontpage_desc don't work at all for me. The following patch fixes it.

--- ./wordpress-seo/frontend/class-opengraph.php~       2013-04-05 12:05:45.000000000 +0200
+++ ./wordpress-seo/frontend/class-opengraph.php        2013-04-05 12:02:44.000000000 +0200
@@ -250,11 +250,11 @@
         * @return bool
         */
        public function image() {
-               if ( is_singular() ) {
+               if ( is_singular() || is_front_page() ) {
                        global $post;

                        if ( is_front_page() ) {
-                               if ( isset( $this->options['og_frontpage_image'] ) )
+                               if ( isset( $this->options['og_frontpage_image'] ) )
                                        $this->image_output( $this->options['og_frontpage_image'] );
                        }

@@ -284,7 +284,11 @@
         * @return string $ogdesc
         */
        public function description( $echo = true ) {
-               $ogdesc = wpseo_get_value( 'opengraph-description' );
+        if ( is_front_page() && isset( $this->options['og_frontpage_desc'] ) ) {
+            $ogdesc = $this->options['og_frontpage_desc'];
+        } else {
+            $ogdesc = wpseo_get_value( 'opengraph-description' );
+        }

                if ( !$ogdesc )
                        $ogdesc = $this->metadesc( false );

http://wordpress.org/extend/plugins/wordpress-seo/


Viewing all articles
Browse latest Browse all 42467

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>