Account for page/post ID mismatch
This commit is contained in:
parent
9525e27b82
commit
8bf1ab8a2d
@ -22,6 +22,13 @@
|
||||
|
||||
<?php
|
||||
|
||||
// IDs
|
||||
$page_id = get_queried_object_id();
|
||||
|
||||
if ( $page_id != $args['post_id'] ) {
|
||||
$args['post_id'] = $page_id;
|
||||
}
|
||||
|
||||
// Null post ID for generated pages
|
||||
if ( is_archive() || is_search() || is_404() ) {
|
||||
$args['post_id'] = null;
|
||||
|
@ -23,9 +23,14 @@
|
||||
|
||||
global $post;
|
||||
|
||||
// Post ID
|
||||
// IDs
|
||||
$page_id = get_queried_object_id();
|
||||
$post_id = $post ? $post->ID : null;
|
||||
|
||||
if ( $page_id != $post_id ) {
|
||||
$post_id = $page_id;
|
||||
}
|
||||
|
||||
if ( is_archive() || is_search() || is_404() ) {
|
||||
$post_id = null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user