Advertisement
Guest User

header.php

a guest
May 21st, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.53 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="es-ES">
  3. <head>
  4. <title><?php if(is_home()) { echo get_bloginfo("title"); } else { wp_title('- '.get_bloginfo("title").'', true, 'right'); } ?></title>
  5. <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  7. <?php
  8. if (have_posts()): while(have_posts()) : the_post();
  9. $description = string_limit_words(get_the_excerpt(), 20);
  10. endwhile; endif;
  11. if(is_single()){
  12. $pro_url = "<meta property='og:url' content='".get_permalink()."'/>";
  13. $pro_descripcion = "<meta property='og:description' content='".$description."'/>";
  14. $pro_type = "<meta property='og:type' content='article'/>";
  15. $pro_title = "<meta property='og:title' content='".get_the_title()."'/>";
  16. } else {
  17. $pro_url = "<meta property='og:url' content='".get_bloginfo("url")."'/>";
  18. $pro_descripcion = "<meta property='og:description' content='".get_bloginfo("description")."'/>";
  19. $pro_type = "<meta property='og:type' content='website'/>";
  20. $pro_title = "<meta property='og:title' content='".get_bloginfo("title")."'/>";
  21. }
  22. ?>
  23. <?php if(is_404()){
  24. echo '
  25. <meta name="robots" content="noindex,nofollow" />';
  26. } else {
  27. echo '
  28. <meta name="robots" content="index,follow" />';
  29. }
  30. if(has_post_thumbnail()){
  31. $src = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
  32. } else {
  33. if(get_option("sora_logo") == ""){$src = get_bloginfo("template_url")."/images/logo.png"; } else {$src = get_option("sora_logo");}
  34. }
  35. echo "
  36. <meta property='og:locale' content='es_ES'/>
  37. $pro_title
  38. $pro_descripcion
  39. $pro_url
  40. <meta property='og:site_name' content='".get_bloginfo("title")."'/>
  41. <meta property='og:image' content='".$src."'/>
  42. $pro_type
  43. ";
  44. ?>
  45. <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
  46. <?php
  47. if(get_option("sora_favicon")){
  48. $favicon = get_option("sora_favicon");
  49. } else {
  50. $favicon = get_bloginfo('template_directory')."/images/favicon.ico"; }
  51. echo '<link rel="shortcut icon" href="'.$favicon.'" />'; ?>
  52. <?php
  53. if (get_option("sora_fuente_css")) {
  54. $fuente_css = stripslashes(get_option("sora_fuente_css"));
  55. echo $fuente_css;
  56. } else {
  57. echo "<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css'>";
  58. }
  59. ?>
  60.  
  61. <?php echo stripslashes(get_option('sora_header_codigos')); ?>
  62. <?php wp_head(); ?>
  63. <script type="text/javascript">
  64. function menu_res(){
  65. if( document.getElementById('container').style.display == 'inherit'){
  66. document.getElementById('container').style.display = 'none';
  67. } else {
  68. document.getElementById('container').style.display = 'inherit';
  69. }
  70. }
  71. </script>
  72. <style type="text/css">
  73. <?php
  74. if(get_option("sora_fuente_nombre")){
  75. $fuente_nombre = get_option("sora_fuente_nombre");
  76. echo 'body, input {font-family:'.$fuente_nombre.' !important}';
  77. }
  78.  
  79. if(get_option("sora_fuente_tamaño")){
  80. echo '.entry {font-size: '.get_option("sora_fuente_tamaño").'}';
  81. if(get_option("sora_fuente_tamaño") == "small"){
  82. echo '
  83. body {font-size:small !important}
  84. #bread, .meta, .post-ratings, .etiquetas {font-size:11px !important}
  85. #header #menu li a, #header #menu li a:hover, .etiquetas a, .etiquetas a:hover, .tagcloud a, .tagcloud a:hover, .readmore, #header .menu_res li a:hover {font-size:small !important}
  86. .sidetitle, #relacionados h2, #comentarios h2, #author-info h3, #relacionados h2, #comentarios h2, .superior h1.p {font-size:medium !important}';
  87. }
  88. elseif(get_option("sora_fuente_tamaño") == "large"){
  89. echo '
  90. body, #commentform #submit, #sidebar {font-size:large !important}
  91. #contenido h2.tp2 a, #contenido h1.tp {font-size:40px !important; line-height:45px}';
  92. echo '#bread, .meta, .post-ratings {font-size:14px !important}
  93. #header #menu li a, #header #menu li a:hover, .etiquetas a, .etiquetas a:hover, .tagcloud a, .tagcloud a:hover, .etiquetas, .readmore, .mas_comentadas ul .fecha, .ultimas_entradas .fecha, .readmore, .tagcloud, #footer, .paginador, #searchsubmit, .feedburner-subscribe, #searchform #s, .feedburner-email, #author-info, #relacionados ul li a, #comentarios .tpp li a {font-size:medium !important}
  94. .sidetitle, #relacionados h2, #comentarios h2, #author-info h3, #relacionados h2, #comentarios h2, .superior h1.p {font-size:larger !important}';
  95. }
  96. elseif(get_option("sora_fuente_tamaño") == "larger"){
  97. echo '
  98. body, #commentform #submit, #sidebar {font-size:larger !important}
  99. #contenido h2.tp2 a, #contenido h1.tp {font-size:45px !important; line-height:50px}';
  100. echo '#bread, .meta, .post-ratings {font-size:17px !important}
  101. #header #menu li a, #header #menu li a:hover, .etiquetas a, .etiquetas a:hover, .tagcloud a, .tagcloud a:hover, .etiquetas, .readmore, .mas_comentadas ul .fecha, .ultimas_entradas .fecha, .readmore, .tagcloud, #footer, .paginador, #searchsubmit, .feedburner-subscribe, #searchform #s, .feedburner-email, #author-info, #relacionados ul li a, #comentarios .tpp li a {font-size:large !important}
  102. .sidetitle, #relacionados h2, #comentarios h2, #author-info h3, #relacionados h2, #comentarios h2, .superior h1.p, #header .menu_res .menu-link {font-size:x-large !important}';
  103. }
  104. }
  105.  
  106. $color = "#".get_option('sora_color_todo');
  107. $color_menu = "#".get_option('sora_color_menu');
  108. $color_menu_a = "#".get_option('sora_color_menu_a');
  109. $color_footer = "#".get_option('sora_color_footer');
  110. $color_footer_a = "#".get_option('sora_color_footer_a');
  111. $color_fondo = "#".get_option('sora_fondo_color');
  112. $header_color = "#".get_option('sora_header_color');
  113. $fondo_imagen = get_option('sora_fondo_imagen');
  114. if(!get_option('sora_color_todo')){
  115. $color = "#0FADD5";
  116. $color_menu = "#CEEEF6";
  117. $color_menu_a = "#0FADD5";
  118. $color_footer = "#0FADD5";
  119. $color_footer_a = "#FFFFFF";
  120. $color_fondo = "#F2F2F2";
  121. $header_color = "#0FADD5";
  122. }
  123. $rgba = hex2rgb($color);
  124. $rgba_1 = $rgba[0];
  125. $rgba_2 = $rgba[1];
  126. $rgba_3 = $rgba[2];
  127.  
  128. $rgba_menu = hex2rgb($color_menu);
  129. $rgba_menu_1 = $rgba_menu[0];
  130. $rgba_menu_2 = $rgba_menu[1];
  131. $rgba_menu_3 = $rgba_menu[2];
  132. $rgba_menu = "$rgba_menu_1, $rgba_menu_2, $rgba_menu_3";?>
  133. body {background-color: <?php echo $color_fondo; ?>; background-image:url(<?php echo $fondo_imagen; ?>)}
  134. a {color:<?php echo $color; ?>}
  135. #menu li .sub-menu a:hover {color:<?php echo $color_menu_a; ?>}
  136. .tagcloud a:hover, .sidetitle, #relacionados h2, #author-info, #comentarios .tpp, #relacionados ul li a:hover img, #comentarios .tpp li a {border-color:<?php echo $color; ?>}
  137. #header, #footer, .etiquetas a:hover, .etiquetas .normal, .mas_comentadas ul .plus, .paginador a:hover, .paginador a:hover, .paginador .est, .tagcloud a:hover, #searchsubmit, .feedburner-subscribe, .commentlist .comment-body .comment-reply-link, #commentform #submit, #comentarios .tpp li a, .mas_comentadas .bloque:hover {background:<?php echo $color; ?>}
  138. #header {background:<?php echo $header_color; ?>}
  139. <?php
  140. $color1 = $rgba[0];
  141. $color2 = $rgba[1]-10;
  142. $color3 = $rgba[2]-30;
  143. $mezcla = "$color1, $color2, $color3";
  144. ?>
  145. #header #menu .menu .sub-menu li a {color: <?php echo $color_menu_a ?>}
  146. #header #menu .menu .sub-menu {background:#FFF; border:2px solid <?php echo $color_menu ?>}
  147.  
  148. #header #menu .menu .sub-menu li a:hover {background:rgba(<?php echo $rgba_menu ?>,0.8)}
  149. #header #menu .sub-menu li a {border-bottom:1px solid rgba(<?php echo $rgba_menu ?>,0.2)}
  150. .mas_comentadas .bloque_1, #contenido h2.tp2 a:hover {border-color:rgba(<?php echo $mezcla ?>,1)}
  151. .mas_comentadas .bloque_2 {border-color:rgba(<?php echo $mezcla ?>,0.8)}
  152. .mas_comentadas .bloque_3, #contenido h2.tp2 a, #contenido h1.tp {border-color:rgba(<?php echo $mezcla ?>,0.6)}
  153. .mas_comentadas .bloque_4 {border-color:rgba(<?php echo $mezcla ?>,0.4)}
  154. .mas_comentadas .bloque_5 {border-color:rgba(<?php echo $mezcla ?>,0.2)}
  155. <?php
  156. if(get_option('sora_sidebar') == "izquierda"){
  157. echo '#sidebar {float:left}
  158. #contenido {float:right}';
  159. }
  160. ?>
  161. #menu, #header .menu_res, #header #menu li a {background:<?php echo $color_menu; ?>}
  162. #menu a, #header .menu_res a {color:<?php echo $color_menu_a; ?> !important}
  163. #header #menu .menu .sub-menu li a {background:rgba(<?php echo $rgba_menu ?>,0.7)}
  164. #header #menu li a:hover, #header .menu_res li a:hover {background:rgba(250, 250, 250,0.3); text-decoration:none}
  165. #footer {background:<?php echo $color_footer; ?>}
  166. #footer a {color:<?php echo $color_footer_a; ?>}
  167. <?php if(get_option("sora_orden_comentarios") == "fb"){
  168. echo '#comentarios_fb {display:inherit}
  169. #comentarios_g, #comentarios_n {display:none}';
  170. }
  171. elseif(get_option("sora_orden_comentarios") == "g"){
  172. echo '#comentarios_g {display:inherit}
  173. #comentarios_fb, #comentarios_n {display:none}';
  174. }
  175. ?>
  176. </style>
  177.  
  178. </head>
  179. <body>
  180. <div id="fb-root"></div>
  181. <script>(function(d, s, id) {
  182. var js, fjs = d.getElementsByTagName(s)[0];
  183. if (d.getElementById(id)) return;
  184. js = d.createElement(s); js.id = id;
  185. js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1";
  186. fjs.parentNode.insertBefore(js, fjs);
  187. }(document, 'script', 'facebook-jssdk'));</script>
  188.  
  189. <div id="header">
  190. <div class="contenido"><a href="<?php bloginfo("url"); ?>"><img src="<?php
  191. if(get_option("sora_logo")){
  192. echo get_option("sora_logo");
  193. } else {
  194. echo bloginfo("template_directory")."/images/logo.png";
  195. }?>" alt="<?php bloginfo("title"); ?>" class="logo" /></a>
  196. <div class="social">
  197. <?php
  198. if(get_option("sora_facebook") != ''){
  199. echo '<a href="'.get_option("sora_facebook").'" target="_blank" title="Nuestro Facebook" class="facebook"><img src="'.get_bloginfo("template_url").'/images/facebook.png" alt="Nuestro Facebook" /></a> ';
  200. }
  201. if(get_option("sora_twitter") != ''){
  202. echo '<a href="'.get_option("sora_twitter").'" target="_blank" title="Nuestro Twitter" class="twitter"><img src="'.get_bloginfo("template_url").'/images/twitter.png" alt="Nuestro Twitter" /></a> ';
  203. }
  204. if(get_option("sora_google+") != ''){
  205. echo '<a href="'.get_option("sora_google+").'" target="_blank" title="Google Plus" class="google_plus"><img src="'.get_bloginfo("template_url").'/images/google+.png" alt="Google Plus" /></a> ';
  206. }
  207. if(get_option("sora_youtube") != ''){
  208. echo '<a href="'.get_option("sora_youtube").'" target="_blank" title="Canal de YouTube" class="youtube"><img src="'.get_bloginfo("template_url").'/images/youtube.png" alt="Canal de YouTube" /></a> ';
  209. }
  210. if(get_option("sora_rss") != ''){
  211. echo '<a href="'.get_option("sora_rss").'" target="_blank" title="RSS" class="rss"><img src="'.get_bloginfo("template_url").'/images/rss.png" alt="RSS" /></a> ';
  212. }
  213. if(get_option("sora_pinterest") != ''){
  214. echo '<a href="'.get_option("sora_pinterest").'" target="_blank" title="Pinterest" class="pinterest"><img src="'.get_bloginfo("template_url").'/images/pinterest.png" alt="Pinterest" /></a> ';
  215. }
  216. if(get_option("sora_scoop") != ''){
  217. echo '<a href="'.get_option("sora_scoop").'" target="_blank" title="Scoop" class="scoop"><img src="'.get_bloginfo("template_url").'/images/scoop.png" alt="Scoop" /></a> ';
  218. }
  219. ?>
  220. </div>
  221. </div>
  222. <div id="menu"><?php wp_nav_menu(array('theme_location' => 'menu', 'show_home' => true, 'menu_class'=> 'menu')); ?></div>
  223. <div class="menu_res">
  224. <a href="javascript:menu_res()" class="menu-link">Menú</a>
  225. <?php wp_nav_menu(array('theme_location' => 'menu', 'show_home' => true, 'container_id' => 'container')); ?></div></div>
  226. <?php if(ads("ads_728x90")) echo '<div class="ads_728x90">'.ads("ads_728x90").'</div>';
  227. elseif(ads("ads_728x15")) echo '<div class="ads_728x15">'.ads("ads_728x15").'</div>'; ?><div id="pag">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement