Advertisement
aitormendez

Roots_title function spanish traslation

Feb 13th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.37 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Page titles
  4.  */
  5. function roots_title() {
  6.   if (is_home()) {
  7.     if (get_option('page_for_posts', true)) {
  8.       return get_the_title(get_option('page_for_posts', true));
  9.     } else {
  10.       return __('Últimas entradas', 'roots');
  11.     }
  12.   } elseif (is_archive()) {
  13.     $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
  14.     if ($term) {
  15.       return apply_filters('single_term_title', $term->name);
  16.     } elseif (is_post_type_archive()) {
  17.       return apply_filters('the_title', get_queried_object()->labels->name);
  18.     } elseif (is_day()) {
  19.       return sprintf(__('Archivos diarios: %s', 'roots'), get_the_date());
  20.     } elseif (is_month()) {
  21.       return sprintf(__('Archivos mensuales: %s', 'roots'), get_the_date('F Y'));
  22.     } elseif (is_year()) {
  23.       return sprintf(__('Archivos anuales: %s', 'roots'), get_the_date('Y'));
  24.     } elseif (is_author()) {
  25.       $author = get_queried_object();
  26.       return sprintf(__('Archivos por autor: %s', 'roots'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
  27.     } else {
  28.       return single_cat_title('', false);
  29.     }
  30.   } elseif (is_search()) {
  31.     return sprintf(__('Resultado de búsqueda para %s', 'roots'), get_search_query());
  32.   } elseif (is_404()) {
  33.     return __('No encontrado', 'roots');
  34.   } else {
  35.     return get_the_title();
  36.   }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement