-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
149 lines (129 loc) · 5.28 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
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<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 CEDOBI_BLOGNAME;
// Add the blog description for the home/front page.
if ( CEDOBI_BLOGDESC && ( is_home() || is_front_page() ) )
echo " | " . CEDOBI_BLOGDESC;
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s','cedobi' ), max( $paged, $page ) );
?>
</title>
<?php // metatags generation
if ( is_single() || is_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,'extralarge', true);
$metaimg = $img_array[0];
} else {
$metaimg = get_bloginfo('stylesheet_url'). "/images/cedobi-logo.png";
}
$metaperma = get_permalink();
} else {
$metadesc = CEDOBI_BLOGDESC;
$metadesc_tw = CEDOBI_BLOGDESC;
$metadesc_fb = CEDOBI_BLOGDESC;
$metatit = CEDOBI_BLOGNAME;
$metatype = "website";
$metaimg = CEDOBI_BLOGTHEME. "/images/cedobi-logo.png";
$metaperma = CEDOBI_BLOGURL;
}
?>
<!-- generic meta -->
<meta content="<?php echo CEDOBI_BLOGNAME ?>" name="author" />
<meta content="<?php echo CEDOBI_BLOGDESC ?>" name="description" />
<meta content="<?php _e('international brigades, spanish civil war, international brigadiers','cedobi'); ?>" 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 ?>" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="alternate" type="application/rss+xml" title="<?php echo CEDOBI_BLOGNAME; ?> RSS Feed suscription" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php echo CEDOBI_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(); ?>>
<div id="pre" class="container">
<div class="row">
<div id="pre-margeni" class="col-md-3 col-sm-3">
<a href="<?php echo CEDOBI_BLOGURL ?>" title="<?php echo CEDOBI_BLOGDESC ?>"><img src="<?php echo CEDOBI_BLOGTHEME. "/images/cedobi-imago.png"; ?>" alt="<?php echo CEDOBI_BLOGNAME ?>" /></a>
</div><!-- #pre-margeni -->
<div id="pre-main" class="col-md-18 col-sm-17 col-xs-16">
<div class="row">
<?php echo "<div id='logo' class='col-lg-4 col-md-5'>" .CEDOBI_BLOGNAME. "</div>
<div id='tagline' class='col-lg-20 col-md-19'>" .CEDOBI_BLOGDESC. "</div>"; ?>
</div>
<div class="row">
<div class="col-sm-24">
<nav id="pre-nav" class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#cedobi-pre-nav-collapse">
<span class="sr-only"><?php _e('Toggle menu','cedobi'); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="cedobi-pre-nav-collapse">
<?php
$menu_args = array(
'theme_location' => 'pre-nav',
'container' => false,
'menu_class' => 'nav navbar-nav',
'menu_id' => 'navbar-main',
'walker' => ''
);
wp_nav_menu( $menu_args );
?>
</div>
</div>
</nav>
</div>
</div>
</div><!-- #pre-main -->
<div id="pre-margend" class="col-md-3 col-sm-4 col-xs-8">
<ul id="cedobi-social" class="list-inline">
<li id="cedobi-fb"><a title="Facebook" href="https://facebook.com/cedobi">Facebook</a></li>
<li id="cedobi-fk"><a title="Flickr" href="http://flickr.com/photos/iea__cedobi">Flickr</a></li>
<li id="cedobi-rss"><a title="Feed RSS" href="<?php echo CEDOBI_BLOGURL. "feed"; ?>">RSS</a></li>
</ul>
<?php if ( function_exists('pll_the_languages') ) { // language switcher from Polylang
$args = array(
'dropdown' => 1,
'hide_if_no_translation' => 1,
'hide_current' => 1
);
pll_the_languages( $args );
} ?>
</div><!-- #pre-margeni -->
</div><!-- .row -->
</div><!-- #pre .container -->