예제 #1
0
 /**
  * add_authorship()
  *
  * @param void
  * @return void
  **/
 function add_authorship()
 {
     $gplus = false;
     $options = sem_seo::get_options();
     if (is_singular() && !is_front_page()) {
         global $post;
         $gplus = get_the_author_meta('googleplus', $post->post_author);
     }
     if (is_author() && get_query_var('author')) {
         $gplus = get_the_author_meta('googleplus', get_query_var('author'));
     }
     if (is_front_page()) {
         if (isset($options['google_plus_publisher']) && !empty($options['google_plus_publisher'])) {
             echo '<link rel="publisher" href="' . esc_url($options['google_plus_publisher']) . '"/>' . "\n";
         }
     }
     if ($gplus) {
         echo '<link rel="author" href="' . esc_url($gplus) . '"/>' . "\n";
     }
 }
예제 #2
0
 /**
  * edit_options()
  *
  * @return void
  **/
 static function edit_options()
 {
     $options = sem_seo::get_options();
     echo '<div class="wrap">' . "\n" . '<form method="post" action="">' . "\n";
     wp_nonce_field('sem_seo');
     echo '<h2>' . __('SEO Settings', 'sem-seo') . '</h2>' . "\n";
     echo '<h3>' . __('Site Title &amp; Meta', 'sem-seo') . '</h3>' . "\n";
     echo '<table class="form-table">' . "\n";
     foreach (sem_seo_admin::get_fields('ext_meta') as $field => $details) {
         switch ($field) {
             case 'description':
                 echo '<tr valign="top">' . '<th scope="row">' . $details['label'] . '</th>' . '<td>' . '<textarea name="' . $field . '" cols="58" rows="4" class="widefat">' . esc_html($options[$field]) . '</textarea>' . $details['desc'] . "\n" . '</td>' . '</tr>' . "\n";
                 break;
             case 'title':
             case 'keywords':
             case 'google_plus_publisher':
                 echo '<tr valign="top">' . '<th scope="row">' . $details['label'] . '</th>' . '<td>' . '<input type="text" name="' . $field . '" size="58" class="widefat"' . ' value="' . esc_attr($options[$field]) . '"' . ' />' . $details['desc'] . "\n" . '</td>' . '</tr>' . "\n";
                 break;
             default:
                 echo '<tr valign="top">' . '<th scope="row">' . $details['label'] . '</th>' . '<td>' . '<label>' . '<input type="checkbox" name="' . $field . '"' . (!empty($options[$field]) ? ' checked="checked"' : '') . ' />' . '&nbsp;' . $details['desc'] . '</label>' . '</td>' . '</tr>' . "\n";
                 break;
         }
     }
     echo '</table>' . "\n";
     echo '<p class="submit">' . '<input type="submit"' . ' value="' . esc_attr(__('Save Changes', 'sem-seo')) . '"' . ' />' . '</p>' . "\n";
     echo '<h3>' . __('Archive Pages', 'sem-seo') . '</h3>' . "\n";
     echo '<p>' . __('The general idea here is to prevent archive pages from outperforming your blog posts. Pages with very similar content on a site get clustered.', 'sem-seo') . '</p>' . "\n";
     echo '<p>' . __('By sticking to short excerpts or lists of post titles on archive pages, you prevent these pages from competing with your posts, while continuing to benefit from archive pages with high ranking power. In WordPress, archives pages include category, tag, author and date archives.', 'sem-seo') . '</p>' . "\n";
     echo '<p>' . __('On most sites, you\'ll want to stick to the defaults: post excerpts on category pages, and lists of posts everywhere else. An exception might be a site with very few categories, with posts each in a single category, and the opt-in front page enabled. In the latter case, it makes sense to output a normal blog page for categories.', 'sem-seo') . '</p>' . "\n";
     echo '<table class="form-table">' . "\n";
     foreach (sem_seo_admin::get_fields('archives') as $field => $details) {
         echo '<tr valign="top">' . '<th scope="row">' . $details['label'] . '</th>' . '<td>' . '<select name="' . $field . '">' . "\n";
         foreach (array('' => __('Display a normal blog page', 'sem-seo'), 'excerpts' => __('Display a normal blog page, but stick to excerpts', 'sem-seo'), 'list' => __('Display a list of post titles, grouped by date', 'sem-seo'), 'raw_list' => __('Display a raw list of post titles, without dates', 'sem-seo')) as $k => $v) {
             echo '<option value="' . $k . '"' . selected((string) $options[$field], $k, false) . '>' . $v . '</option>' . "\n";
         }
         echo '</select>' . "\n" . '</td>' . '</tr>' . "\n";
     }
     echo '</table>' . "\n";
     /* TODO:  add robots control  */
     echo '<p class="submit">' . '<input type="submit"' . ' value="' . esc_attr(__('Save Changes', 'sem-seo')) . '"' . ' />' . '</p>' . "\n";
     echo '</form>' . "\n";
     echo '</div>' . "\n";
 }