Show Custom Site Title or Tagline per Page

to have a custom site title and/or tagline on different pages (static pages only) of your WordPress site;
one possible approach:

/*
* customize different Site Title 
* and Tagline per (static) page
*/

// create meta boxe for 'Custom Site Title' field below page editor

add_action( 'admin_menu', 'custom_site_title' );
add_action( 'save_post', 'save_custom_site_title' );

function custom_site_title() {
	add_meta_box( 'custom_site_title', 'Custom Site Title for this page <small>(if left empty, the general Site Title will be used)</small>', 'custom_site_title_input_function', 'page', 'normal', 'high' );
}

function custom_site_title_input_function() {
	global $post;
	echo '<input type="hidden" name="custom_site_title_input_hidden" id="custom_site_title_input_hidden" value="'.wp_create_nonce( 'custom_site_title-nonce' ).'" />';
	echo '<input type="text" name="custom_site_title_input" id="custom_site_title_input" style="width:100%;" value="'.get_post_meta( $post->ID, '_custom_site_title', true ).'" />';
}

function save_custom_site_title( $post_id ) {
	if (isset( $_POST['custom_site_title_input_hidden'] )) if (!wp_verify_nonce($_POST['custom_site_title_input_hidden'], 'custom_site_title-nonce')) return $post_id;
	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id;
	if (isset( $_POST['custom_site_title'] )) {
		$customSiteTitle = $_POST['custom_site_title_input'];
		update_post_meta( $post_id, '_custom_site_title', $customSiteTitle );
	}
}

// create meta boxe for 'Custom Tagline' field below page editor

add_action( 'admin_menu', 'custom_site_tagline' );
add_action( 'save_post', 'save_custom_site_tagline' );

function custom_site_tagline() {
	add_meta_box( 'custom_site_tagline', 'Custom Tagline for this page <small>(if left empty, the general Tagline will be used)</small>', 'custom_site_tagline_input_function', 'page', 'normal', 'high' );
}

function custom_site_tagline_input_function() {
	global $post;
	echo '<input type="hidden" name="custom_site_tagline_input_hidden" id="custom_site_tagline_input_hidden" value="'.wp_create_nonce( 'custom_site_tagline-nonce' ).'" />';
	echo '<input type="text" name="custom_site_tagline_input" id="custom_site_tagline_input" style="width:100%;" value="'.get_post_meta( $post->ID, '_custom_site_tagline', true ).'" />';
}

function save_custom_site_tagline( $post_id ) {
	if (isset( $_POST['custom_site_tagline_input_hidden'] )) if (!wp_verify_nonce($_POST['custom_site_tagline_input_hidden'], 'custom_site_tagline-nonce')) return $post_id;
	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id;
	if (isset( $_POST['custom_site_tagline'] )) {
		$customSiteTagline = $_POST['custom_site_tagline_input'];
		update_post_meta( $post_id, '_custom_site_tagline', $customSiteTagline );
	}
}

//preparing the output

add_filter( 'bloginfo', 'custom_site_title_tagline_output', 2, 10 );

function custom_site_title_tagline_output( $site_bloginfo, $show ) {
	global $post;
	if( $show == 'name' && is_page() && get_post_meta( $post->ID, '_custom_site_title', true ) ) {
		$site_bloginfo = get_post_meta( $post->ID, '_custom_site_title', true );
	}
	if( $show == 'description' && is_page() && get_post_meta( $post->ID, '_custom_site_tagline', true ) ) {
		$site_bloginfo = get_post_meta( $post->ID, '_custom_site_tagline', true );
	}
	return $site_bloginfo;
}

add the code to functions.php of your theme; could also be made into a plugin as it is not theme dependant.
might also change meta title and/or tagline; not tested for interference with seo plugins.
code in pastebin https://pastebin.com/n9Xd5uZg

Better Gallery Alignment in Twenty Seventeen

The new theme Twenty Seventeen shows the right thumbnail image in the default 3-column gallery with just a little space to its right,  which is particular noticable when you post a full width image directly above or below the gallery.

To have clear left and right lines in your site, add this CSS to your theme, either into style.css of a child theme, or into the ‘Appearance – Customize – Additonal CSS’:

/*aligning 3-column gallery*/

.gallery-item {
  margin-right: 4%;
  padding-right: 0;
  width: 48%;
}
.gallery-item:nth-child( 2n ) {
  margin-right: 0;
}
@media screen and (min-width: 30em) {
  .gallery-columns-3 .gallery-item {
    padding-right: 0;
    width: 31.5%;
    margin-right: 2.75%;
  }
  .gallery-columns-3 .gallery-item:nth-child( 3n ) {
    margin-right: 0;
  }
}

If you want to change the gallery to show one column only in narrow browsers such as mobile phones, change the CSS to this variation:

/*aligning 3-column gallery - variation*/

.gallery-item {
  padding-right: 0;
  width: 100%;
}
@media screen and (min-width: 22em) {
  .gallery-item {
    margin-right: 4%;
    padding-right: 0;
    width: 48%;
  }
  .gallery-item:nth-child( 2n ) {
    margin-right: 0;
  }
}
@media screen and (min-width: 30em) {
  .gallery-columns-3 .gallery-item {
    padding-right: 0;
    width: 31.5%;
    margin-right: 2.75%;
  }
  .gallery-columns-3 .gallery-item:nth-child( 3n ) {
    margin-right: 0;
  }
}

Injecting Multiple adsense Ads into a WordPress Loop

The versatile code injects for instance adsense ad codes several times into the posts of an index or archive page, starting with a pre-set post, and then repeated in regular intervals (up to a set limit of ads per page).

For example, in a child theme of Twenty Fourteen, this code would be added into content.php at a suitable location:

<?php 
//set the variables//
$nth = 3; //1,2,3,,4...; repeated every n-th post
$snr = 1; //1,2,3...; pre-set start with post nr
$limit = 3; //adsene TOS limit of ads per web page

$lsnr = $snr - 1; // correct for loop counter start at zero

if( $wp_query->current_post >= $lsnr && ( $wp_query->current_post - $lsnr )%$nth == 0 && (int)(( $wp_query->current_post - $lsnr ) / $nth ) < $limit ) { ?>
ADSENSE CODE
<?php } ?>

The example values would start the add in the first post, and repeated every three posts for a maximum of 3 ads.

A Real ‘Full Width Page’ Template for Twenty Fourteen

To create a real full width page – with no sidebars whatsoever – in your WordPress site while using a child theme of the default theme Twenty Fourteen, program this page template file with the file name real-full-width.php (important as this is referenced in the CSS) and save it in a sub-folder /page-templates in the child theme:

<?php
/**
 * Template Name: Real Full Width Page
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */

get_header(); ?>

<div id="main-content" class="main-content">

<?php
	if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
		// Include the featured content template.
		get_template_part( 'featured-content' );
	}
?>

	<div id="primary" class="content-area">
		<div id="content" class="site-content" role="main">
			<?php
				// Start the Loop.
				while ( have_posts() ) : the_post();

					// Include the page content template.
					get_template_part( 'content', 'page' );

					// If comments are open or we have at least one comment, load up the comment template.
					if ( comments_open() || get_comments_number() ) {
						comments_template();
					}
				endwhile;
			?>
		</div><!-- #content -->
	</div><!-- #primary -->
</div><!-- #main-content -->

<?php
get_footer();

Add this section to style.css of the child theme:

.page-template-page-templatesreal-full-width-php .site {
	width: 100%;
}

.page-template-page-templatesreal-full-width-php  .hentry {
	margin: 0 auto 48px;
	max-width: 90%;
}

.page-template-page-templatesreal-full-width-php .site-content .entry-header,
.page-template-page-templatesreal-full-width-php .site-content .entry-content,
.page-template-page-templatesreal-full-width-php .site-content .entry-summary,
.page-template-page-templatesreal-full-width-php .site-content .entry-meta,
.page-template-page-templatesreal-full-width-php .page-content {
	margin: 0 auto;
	max-width: 90%;
}

.page-template-page-templatesreal-full-width-php .main-content,
.page-template-page-templatesreal-full-width-php .content-area {
	float: left;
	width: 100%;
}
.page-template-page-templatesreal-full-width-php .site-content,
.page-template-page-templatesreal-full-width-php .site-main .widecolumn {
	margin-left: 0;
}

.page-template-page-templatesreal-full-width-php .site:before {
	width: 0;
}

.page-template-page-templatesreal-full-width-php .site-content {
	margin-left: 0;
	margin-right: 0;
}

(not optimized)

Activate the template in the ‘Edit Page’ dashboard page, under ‘Page Attributes’ by ticking ‘Real Full Width Page’.