Skip to content

Commit

Permalink
Add template so page loads correct breadcrumb (#259)
Browse files Browse the repository at this point in the history
The region landing template was not available to editors, meaning that
their region landing page was defaulting to the default template. By
using the default template rather than the regional landing template,
there was a knock on effect in that the wrong breadcrumb loaded.
  • Loading branch information
brown-a2 authored and wilson1000-MoJ committed Dec 10, 2019
1 parent 0760958 commit f70e9a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ function clarity_custom_page_attribute_box( $post ) {
$parent_page = wp_get_post_parent_id( $post->ID );



// current template selected by user
$current_template = get_post_meta( $post->ID, '_wp_page_template', true );
// current template selected by user
$current_template = get_post_meta( $post->ID, '_wp_page_template', true );

// get full list of templates
$templates = get_page_templates($post);
$templates = get_page_templates($post);

$themeselect = '<select id="page_template" name="page_template">';
$themeselect = '<select id="page_template" name="page_template">';

foreach ( $templates as $template_name => $template_filename ) {

Expand Down
6 changes: 5 additions & 1 deletion wp-content/themes/clarity/page_regional_landing.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
*
* Template name: Region landing
*
* Template Post Type: regional_page
*/
$terms = get_the_terms( get_the_ID(), 'region' );

Expand All @@ -28,6 +28,10 @@

<h1 class="o-title o-title--page"><?php the_title(); ?></h1>

<div class="template-container ">
<?php get_template_part( 'src/components/c-rich-text-block/view' ); ?>
</div>

<?php
echo '<div id="content">';
get_news_api( 'regional_news' );
Expand Down

0 comments on commit f70e9a5

Please sign in to comment.