Skip to content

Commit

Permalink
Only generate pingback url header tag when relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
Roni Laukkarinen committed Sep 23, 2016
1 parent ee66140 commit 0f7fcc9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ function air_dev_adminbar() { ?>
show_admin_bar(false);
}

/**
* Add a pingback url auto-discovery header for singularly identifiable articles.
*/
function _s_pingback_header() {
if ( is_singular() && pings_open() ) :
echo '<link rel="pingback" href="', bloginfo( 'pingback_url' ), '">';
endif;
}
add_action( 'wp_head', '_s_pingback_header' );

/**
* Custom uploads folder media/ instead of default content/uploads/.
* Comment these out if you want to set up media library folder in wp-admin.
Expand Down
1 change: 0 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<!-- Oh, those icons. Generate: http://realfavicongenerator.net/ -->
<link rel="apple-touch-icon" sizes="57x57" href="<?php echo esc_url( get_template_directory_uri() ); ?>/images/favicons/apple-touch-icon-57x57.png">
Expand Down

0 comments on commit 0f7fcc9

Please sign in to comment.