From fefa1d762c3dd16ad3853f08e1056e3a09cf995e Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Thu, 3 Aug 2023 19:55:33 +0200 Subject: [PATCH] Use null as ID on generated pages --- header.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/header.php b/header.php index f689480b..dd7d99e3 100644 --- a/header.php +++ b/header.php @@ -23,11 +23,11 @@ global $post; -// Post ID (-1 for generated pages) -$post_id = $post ? $post->ID : -1; +// Post ID +$post_id = $post ? $post->ID : null; if ( is_archive() || is_search() || is_404() ) { - $post_id = -1; + $post_id = null; } ?> @@ -54,7 +54,7 @@ if ( is_archive() || is_search() || is_404() ) { ?> - data-post-id=""> + data-post-id=""> 0 ) { + if ( ! empty( $post_id ) ) { // Type? switch ( $post->post_type ) { case 'fcn_story': @@ -85,7 +85,7 @@ if ( is_archive() || is_search() || is_404() ) { } // Filter header image - if ( $header_image_url && $post_id > 0 ) { + if ( ! empty( $post_id ) && $header_image_url ) { $header_image_url = apply_filters( 'fictioneer_filter_header_image', $header_image_url, $post_id ); }