-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.php
186 lines (159 loc) · 6.94 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title>
<?php
/* From twentyeleven theme
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
echo QUINCEM_BLOGNAME;
// Add the blog description for the home/front page.
if ( QUINCEM_BLOGDESC && ( is_home() || is_front_page() ) )
echo " | " . QUINCEM_BLOGDESC;
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | Página ' . max( $paged, $page );
?>
</title>
<?php
// metatags generation
if ( is_single() || is_page() && !is_front_page() ) {
$metadesc = $post->post_excerpt;
if ( $metadesc == '' ) { $metadesc = $post->post_content; }
$metadesc = wp_strip_all_tags($post->post_content);
$metadesc = strip_shortcodes( $metadesc );
$metadesc_fb = substr( $metadesc, 0, 297 );
$metadesc_tw = substr( $metadesc, 0, 200 );
$metadesc = substr( $metadesc, 0, 154 );
$metatit = $post->post_title;
$metatype = "article";
$img_id = get_post_thumbnail_id();
if ( $img_id != '' ) {
$img_array = wp_get_attachment_image_src($img_id,'large', true);
$metaimg = $img_array[0];
} else {
$metaimg = "http://ciudad-escuela.org/wp-content/themes/montera34/screenshot.png";
}
$metaperma = get_permalink();
} elseif ( is_category() ) {
$term = $wp_query->queried_object;
$metadesc = $term->description;
if ( $metadesc == '' ) { $metadesc = "Contenidos en la categoría ".$term->name; }
$metadesc_fb = substr( $metadesc, 0, 297 );
$metadesc_tw = substr( $metadesc, 0, 200 );
$metatit = $term->name;
$metatype = "blog";
$metaperma = "http://ciudadaniaactiva.martadero.org/seccion/".$term->slug;
} elseif ( is_tag() ) {
$term = $wp_query->queried_object;
$metadesc = "Contenidos en con la etiqueta ".$term->name;
$metadesc_fb = substr( $metadesc, 0, 297 );
$metadesc_tw = substr( $metadesc, 0, 200 );
$metatit = $term->name;
$metatype = "blog";
$metaperma = "http://ciudadaniaactiva.martadero.org/etiqueta/".$term->slug;
} else {
$metadesc = QUINCEM_BLOGDESC;
$metadesc_tw = QUINCEM_BLOGDESC;
$metadesc_fb = QUINCEM_BLOGDESC;
$metatit = QUINCEM_BLOGNAME;
$metatype = "website";
$metaimg = "http://ciudadaniaactiva.martadero.org/wp-content/themes/15muebles-master/images/quincem-imago.png";
$metaperma = QUINCEM_BLOGURL;
}
?>
<!-- generic meta -->
<meta content="mARTadero" name="author" />
<meta name="title" content="<?php echo $metatit ?>" />
<meta content="<?php echo $metadesc ?>" name="description" />
<meta content="Pedagogía abierta, pedagogía urbana, pedagogía opensource, pedagogía urbana abierta, escuela abierta, Ciudad Escuela, 15muebles, Open Badges, aprendizaje no reglado, Madrid, Zuloark, Basurama, Domenico Di Siena, Alberto Corsín, Adolfo Estalella, Alfonso Sánchez Uzábal" name="keywords" />
<!-- facebook meta -->
<meta property="og:title" content="<?php echo $metatit ?>" />
<meta property="og:type" content="<?php echo $metatype ?>" />
<meta property="og:description" content="<?php echo $metadesc_fb ?>" />
<meta property="og:url" content="<?php echo $metaperma ?>" />
<meta property="og:image" content="<?php echo $metaimg; ?>" />
<!-- twitter meta -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@martadero">
<meta name="twitter:title" content="<?php echo $metatit ?>">
<meta name="twitter:description" content="<?php echo $metadesc_tw ?>">
<meta name="twitter:creator" content="@15muebles">
<meta name="twitter:image:src" content="<?php echo $metaimg ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="alternate" type="application/rss+xml" title="<?php echo QUINCEM_BLOGNAME; ?> RSS Feed suscription" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php echo QUINCEM_BLOGNAME; ?> Atom Feed suscription" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php
//if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
wp_head(); ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
</head>
<?php // better to use body tag as the main container ?>
<body <?php body_class(); ?>>
<?php
// navbar links
if ( !is_front_page() ) { $link_prefix = QUINCEM_BLOGURL. "/"; }
else { $link_prefix = ""; }
// custom post types info
global $wp_post_types;
// descubre, aprende, haz bands
$band_pts = array("itinerario","badge","actividad","earner");
$band_tits = array("Descubre","Aprende","Haz","Comunidad");
?>
<nav id="pre-navbar" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header quincem-smooth">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#quincem-pre-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo $link_prefix; ?>#top" title="<?php echo QUINCEM_BLOGNAME; ?>"><img src="<?php echo QUINCEM_BLOGTHEME; ?>/images/quincem-logo.png" alt="<?php echo QUINCEM_BLOGNAME; ?>" /></a>
</div>
<div class="collapse navbar-collapse" id="quincem-pre-navbar-collapse">
<ul id="navbar-main" class="nav navbar-nav quincem-smooth">
<?php $nav_count = 0;
foreach ( $band_pts as $pt ) {
if ( is_single() && $wp_query->query_vars['post_type'] == $pt ) {
echo "<li class='active'><a class='" .$pt. "' href='" .$link_prefix. "#" .$pt. "'>" .$band_tits[$nav_count]. "</a></li>";
} else {
echo "<li><a href='" .$link_prefix. "#" .$pt. "'>" .$band_tits[$nav_count]. "</a></li>";
}
$nav_count++;
} ?>
</ul>
<ul id="navbar-sec" class="nav navbar-nav navbar-left">
<?php if ( $wp_query->query_vars['pagename'] == 'about' ) { ?>
<li class="active"><a class="border-band-black" href="">Sobre</a></li>
<?php } else { ?>
<li><a class="border-band-black" href="/about">Sobre</a></li>
<?php } ?>
<li class="navbar-faq"><a href="/preguntas-frecuentes">FAQ</a></li>
<li class="navbar-blog"><a href="/blog">Blog</a></li>
</ul>
<ul id="navbar-third" class="nav navbar-nav navbar-right hidden-sm">
<div style="float: left;margin-top: 15px;margin-right: 10px;">Comparte</div>
<li class="navbar-socialb">
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_sharing_toolbox"></div>
<!-- Place this tag after the last widget tag. -->
<script type="text/javascript">
window.___gcfg = {lang: 'es'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/platform.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</li>
</ul>
</div>
</div>
</nav>