WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Custom Post Type error. (1 post)

  1. twisted1919
    Member
    Posted 2 years ago #

    Installed the seo plugin and after a few days created a new post type.
    Now when going to the archive for that custom post type i get:

    Notice: Undefined index: metakey-competition in /var/www/html/yyy/zzz/wp-content/plugins/wordpress-seo/frontend/class-frontend.php on line 482

    The fix is simple:

    // open class-frontend.php at line 482 and look for:
    if ( !$metakey || empty($metakey) ) {
    $metakey = wpseo_replace_vars($options['metakey-'.$post->post_type], (array) $post );
    }

    and change it with

    if ( (!$metakey || empty($metakey)) && isset($options['metakey-'.$post->post_type]) ) {
    $metakey = wpseo_replace_vars($options['metakey-'.$post->post_type], (array) $post );
    }

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic