Merge pull request #855 from IanDelMar/header

Conditional pingback & child theme friendliness Thx again @IanDelMar
This commit is contained in:
Holger 2018-12-18 14:23:56 +01:00 committed by GitHub
commit fecf45dff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 14 deletions

View File

@ -18,11 +18,7 @@ $container = get_theme_mod( 'understrap_container_type' );
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="<?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?>">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>

View File

@ -111,4 +111,24 @@ if ( ! function_exists ( 'understrap_post_nav' ) ) {
<?php
}
}
}
/**
* Add a pingback url auto-discovery header for single posts of any post type.
*/
function understrap_pingback() {
if ( is_singular() && pings_open() ) {
echo '<link rel="pingback" href="' . esc_url( get_bloginfo( 'pingback_url' ) ) . '">' . "\n";
}
}
add_action( 'wp_head', 'understrap_pingback' );
/**
* Add mobile-web-app meta.
*/
function understrap_mobile_web_app_meta() {
echo '<meta name="mobile-web-app-capable" content="yes">' . "\n";
echo '<meta name="apple-mobile-web-app-capable" content="yes">' . "\n";
echo '<meta name="apple-mobile-web-app-title" content="' . esc_attr( get_bloginfo( 'name' ) ) . ' - ' . esc_attr( get_bloginfo( 'description' ) ) . '">' . "\n";
}
add_action( 'wp_head', 'understrap_mobile_web_app_meta' );

View File

@ -17,20 +17,15 @@ if ( ! defined( 'ABSPATH' ) ) {
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title"
content="<?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?>">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body>
<?php while ( have_posts() ) : the_post(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'loop-templates/content', 'blank' ); ?>
<?php get_template_part( 'loop-templates/content', 'blank' ); ?>
<?php endwhile; // end of the loop. ?>
<?php wp_footer(); ?>
<?php endwhile; // end of the loop. ?>
<?php wp_footer(); ?>
</body>
</html>