Add noindex to hidden chapters

This commit is contained in:
Tetrakern 2023-06-13 11:34:10 +02:00
parent 1864bfd44e
commit f003ffedf9

View File

@ -11,7 +11,21 @@
*/
?>
<?php get_header( null, array( 'type' => 'fcn_chapter' ) ); ?>
<?php
// Header
$is_hidden = fictioneer_get_field( 'fictioneer_chapter_hidden', get_the_ID() ) ?: 0;
$header_args = array(
'type' => 'fcn_chapter'
);
if ( ! empty( $is_hidden ) ) {
$header_args['no_index'] = true;
}
get_header( null, $header_args );
?>
<div class="progress">
<div class="progress__bar"></div>