Changeset 7360
- Timestamp:
- 07/02/2018 11:54:43 PM (7 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main
- Files:
-
- 2 edited
-
functions.php (modified) (1 diff)
-
header-child-page.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
r7359 r7360 193 193 194 194 /** 195 * Customizes the parent page title when rendering as a site title on child pages. 196 * 197 * Example: 'About' on all child pages of the About page. 198 * 199 * @param string $title Post Title. 200 * @param int $post_id Post ID. 201 * @return string 202 */ 203 function parent_page_title( $title, $post_id ) { 204 $title_post = get_post( $post_id ); 205 if ( 'about' === $title_post->post_name && get_post()->post_name !== $title_post->post_name ) { 206 $title = esc_html_x( 'About', 'Page title', 'wporg' ); 207 } 208 209 return $title; 210 } 211 add_filter( 'the_title', __NAMESPACE__ . '\parent_page_title', 11, 2 ); 212 213 /** 195 214 * Custom template tags. 196 215 */ -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/header-child-page.php
r7350 r7360 22 22 <header id="masthead" class="site-header col-12" role="banner"> 23 23 <div class="site-branding"> 24 <p class="site-title"><a href="<?php echo esc_url( home_url( '/about/' ) ); ?>" rel="bookmark"><?php echo esc_html_x( 'About', 'Page title', 'wporg'); ?></a></p>24 <p class="site-title"><a href="<?php echo esc_url( get_permalink( get_post()->post_parent ) ); ?>" rel="bookmark"><?php echo get_the_title( get_post()->post_parent ); ?></a></p> 25 25 26 26 <nav id="site-navigation" class="main-navigation" role="navigation">
Note: See TracChangeset
for help on using the changeset viewer.