/
header-src.php
113 lines (106 loc) · 8.35 KB
/
header-src.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
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage justmarkup.com
* @since justmarkup.com 1.0
*/
?><!DOCTYPE html>
<html class="no-js" lang="en">
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<meta name="theme-color" content="rgba(39,174,96,0.6)" />
<link rel="manifest" href="<?php echo get_template_directory_uri(); ?>/manifest.json" />
<meta http-equiv="origin-trial" data-feature="Web Share" data-expires="2016-12-01" content="AoKbIKSXVxhj3LKywOdYti3sB5YXFUeJ727d8VDPSyMygl7ZmAkCFQXvYKuwWz+LfR+7hwEOKjpH6i/B5gbS3wsAAABVeyJvcmlnaW4iOiAiaHR0cHM6Ly9qdXN0bWFya3VwLmNvbTo0NDMiLCAiZmVhdHVyZSI6ICJXZWJTaGFyZSIsICJleHBpcnkiOiAxNDgwNjI2MzIxfQ==">
<?php
#twitter cards hack
function catch_that_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches[1][0];
if(empty($first_img)) {
$first_img = "";
}
return $first_img;
}
if(is_single() || is_page()) {
$twitter_url = get_permalink();
$twitter_title = get_the_title();
$twitter_desc = get_the_content();
$twitter_thumb = catch_that_image();
$twitter_name = 'justmarkup';
?>
<meta name="twitter:card" value="summary" />
<meta name="twitter:url" value="<?php echo $twitter_url; ?>" />
<meta name="twitter:title" value="<?php echo $twitter_title; ?>" />
<meta name="twitter:description" value="<?php echo $twitter_desc; ?>" />
<meta name="twitter:image" value="<?php echo $twitter_thumb; ?>" />
<meta name="twitter:creator" value="@<?php echo $twitter_name; ?>" />
<?php
}
?>
<title><?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'justmarkup' ), max( $paged, $page ) );
?></title>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
/* We add some JavaScript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
?>
<style>
@{css_include}@
</style>
</head>
<body <?php body_class(); ?>>
<header class="header"role="banner">
<h1><a class="logo" title="Home" href="<?php echo get_home_url(); ?>/"><svg width="120" height="90" xmlns="http://www.w3.org/2000/svg" aria-labelledby="title">
<title id="title">justmarkup</title>
<g>
<g id="text">
<g>
<path d="m30.25079,25.380058h2.677387v18.570969c0,0.848572 -0.032722,1.79636 -0.066769,2.383713c-0.063839,1.075493 -0.326397,1.954918 -0.750416,2.740963c-0.717964,1.271271 -2.05599,2.282909 -3.786922,2.871849l-1.303978,-1.662819c1.206089,-0.489464 2.219059,-1.306652 2.675802,-2.187935c0.424276,-0.75042 0.554895,-1.796116 0.554895,-4.078999v-18.637741l0,0l0,0z" fill="#00CC66"/>
<path d="m38.377926,25.380058h2.64175v14.328636c0,1.53249 0.097889,2.805084 0.2285,3.428062c0.391563,1.762058 2.02301,2.741249 4.537331,2.741249c1.859947,0 3.263153,-0.489727 3.948654,-1.4048c0.686577,-0.91214 0.848312,-1.729591 0.848312,-3.818047v-15.27351h2.643337v15.568787c0,3.19796 -0.326385,4.276104 -1.69688,5.480602c-1.370747,1.176296 -3.166851,1.729591 -5.875359,1.729591c-3.459202,0 -5.581696,-1.109528 -6.626053,-3.230694c-0.489456,-0.978909 -0.651196,-1.437252 -0.651196,-3.917263v-15.632614l0.001602,0l0,0z" fill="#00CC66"/>
<path d="m71.468781,27.045818l-1.178413,1.924042c-2.146431,-1.401867 -3.520119,-1.891331 -5.447891,-1.891331c-2.809864,0 -4.472157,1.401888 -4.472157,3.687181c0,1.793421 1.077072,2.839384 3.722805,3.656569l2.575775,0.814781c1.990295,0.619797 3.067368,1.207413 3.949188,2.253906c0.913208,1.042759 1.467316,2.544655 1.467316,3.948647c0,2.088455 -1.139587,4.048409 -3.09848,5.386181c-1.467331,0.945137 -2.966019,1.370483 -5.026272,1.370483c-2.677124,0 -4.964005,-0.654121 -7.180676,-2.024605l1.170975,-2.088696c1.865269,1.337746 3.753937,1.926956 6.009701,1.926956c1.701397,0 2.606632,-0.261223 3.558941,-0.979439c1.077087,-0.817184 1.600052,-1.891068 1.600052,-3.197716c0,-1.990017 -1.311165,-3.361294 -4.019669,-4.176888l-2.247791,-0.690834c-2.021412,-0.62059 -3.098484,-1.07547 -3.980309,-1.991074c-0.913208,-0.978661 -1.405056,-2.218788 -1.405056,-3.656591c0,-3.817228 2.9035,-6.428123 7.242912,-6.428123c2.419632,0.001589 4.636292,0.719034 6.759048,2.156549l0,0l0,0z" fill="#00CC66"/>
<path d="m74.50061,25.380146h14.81665l-0.16172,2.25161h-6.071045v20.137318h-2.578064v-20.137318h-6.005821v-2.25161l0,0z" fill="#00CC66"/>
</g>
<g>
<path d="m27.316776,55.506214h3.207825l1.615612,6.165844c0.226334,0.887421 0.32,1.241779 0.421471,1.879402c0.124866,-0.637623 0.249733,-1.204277 0.44487,-1.932457l1.662415,-6.112789h3.246815l1.100471,12.315296h-2.442883l-0.468327,-6.573231c-0.04681,-0.780479 -0.101467,-1.313545 -0.101467,-1.967598c-0.140472,0.709427 -0.234138,1.063786 -0.444881,1.80835l-1.951206,6.732479h-2.177544l-1.756084,-6.46706c-0.156065,-0.601799 -0.491728,-2.144821 -0.491728,-2.144821c0,0.726654 -0.039005,1.419712 -0.093615,2.182259l-0.421471,6.431171h-2.497545l1.147272,-12.316845l0,0z" fill="#00CC66"/>
<path d="m43.504211,55.470322h2.676857l3.878952,12.35112h-2.653446l-0.874371,-2.923729h-3.613487l-0.866398,2.923729h-2.583485l4.035378,-12.35112l0,0l0,0zm0.015427,7.370079h2.411644c0,0 -0.405655,-1.291744 -0.671143,-2.479481c-0.124756,-0.56818 -0.491585,-2.180756 -0.491585,-2.180756s-0.359116,1.452427 -0.585484,2.374943c-0.234097,0.886608 -0.39024,1.4729 -0.663433,2.285294l0,0z" fill="#00CC66"/>
<path d="m50.887589,55.488411l4.589203,0.017822c2.185272,0 3.621464,1.45163 3.621464,3.615887c0,1.842125 -1.225506,3.367146 -2.747356,3.40147c0.249779,0.195774 0.351135,0.300598 0.514996,0.514465c0.710255,0.887402 2.958031,4.784981 2.958031,4.784981h-2.926636c-0.476154,-0.813988 -0.671413,-1.149681 -1.147305,-2.018219c-1.225506,-2.216671 -1.615746,-2.802147 -2.037106,-3.012829c-0.125023,-0.053738 -0.202965,-0.088856 -0.39024,-0.106922v5.13958h-2.435051v-12.336235l0,0l0,0l0,0zm2.450478,2.002537l-0.023411,3.331234h0.835278c1.061378,0 1.521843,-0.106922 1.865269,-0.408318c0.296593,-0.281696 0.476158,-0.724888 0.476158,-1.239353c0,-0.762367 -0.304325,-1.274448 -0.889809,-1.507198c-0.280899,-0.105354 -0.796173,-0.176365 -1.397087,-0.176365h-0.866398l0,0l0,0l0,0z" fill="#00CC66"/>
<path d="m61.127396,55.506214h2.536617v5.617188l3.504353,-5.617188h3.051689l-3.933632,5.706131l4.378502,6.609936h-3.262421l-3.738491,-6.431942v6.431942h-2.536617v-12.316067l0,0l0,0z" fill="#00CC66"/>
<path d="m71.624924,55.506214h2.53656v8.096798c0,0.923271 0.031258,1.136383 0.210732,1.471992c0.288795,0.550201 0.874138,0.851509 1.685883,0.851509c1.084862,0 1.771675,-0.533112 1.880943,-1.437691c0.031265,-0.265327 0.031265,-0.443321 0.031265,-1.097359v-7.88525h2.52095v8.294254c0,1.169136 -0.015602,1.398621 -0.195129,1.931679c-0.320007,0.974075 -1.521942,2.321182 -4.183426,2.321182c-1.880951,0 -3.246826,-0.568199 -3.949234,-1.647644c-0.405869,-0.638397 -0.530731,-1.136383 -0.530731,-2.321884v-8.577587l-0.007813,0l0,0z" fill="#00CC66"/>
<path d="m82.629745,55.470367h3.239014c2.091736,0 2.731743,0.213821 3.426353,0.602482c1.147339,0.639233 1.771683,1.770981 1.771683,3.19067c0,1.629604 -0.780479,2.975174 -2.130684,3.614407c-0.569801,0.26535 -1.100471,0.406639 -2.466347,0.406639h-1.365875v4.536945h-2.474144v-12.351143l0,0l0,0zm2.481934,2.002712v3.792339h1.287811c1.014679,0 1.311218,-0.124107 1.646812,-0.637623c0.218536,-0.337994 0.304398,-0.726654 0.304398,-1.312771c0,-1.151249 -0.624336,-1.841946 -1.662399,-1.841946h-1.576622l0,0l0,0z" fill="#00CC66"/>
</g>
<polyline id="poly-left" points="14.154014587402344,41.89519500732422 14.154014587402344,9.538511276245117 46.51069259643555,9.538511276245117 " stroke="#00CC66" fill="none"/>
<polyline id="poly-right" points="105.845703125,48.104305267333984 105.845703125,80.46099853515625 73.48605346679688,80.46099853515625 " stroke="#00CC66" fill="none"/>
</g>
</g>
</svg></a></h1>
<nav class="nav" role="navigation">
<?php wp_nav_menu(); ?>
</nav>
</header>