我好像不明白我的页码是怎么回事?当访问/blog/ page /2时,页面将转到404页。帮我伙计们?
'blog',
'post_status' => 'publish',
'paged' => $paged
));
if ($querys->have_posts()) {
while ($querys->have_posts()) {
$querys->the_post(); ?>
ID)) : ?>
ID), 'single-post-thumbnail'); ?>
ID, 'blog_taxonomy');
foreach ($categories as $category) { ?>
name; ?>
No Posts Found Of This Category
$querys)); ?>发布于 2022-05-11 11:08:03
function wphelp_custom_pre_get_posts( $query ) {
if( $query->is_main_query() && !$query->is_feed() && !is_admin() && is_category()) {
$query->set( 'paged', str_replace( '/', '', get_query_var( 'page' ) ) ); } }
add_action('pre_get_posts','wphelp_custom_pre_get_posts');
function wphelp_custom_request($query_string ) {
if( isset( $query_string['page'] ) ) {
if( ''!=$query_string['page'] ) {
if( isset( $query_string['name'] ) ) { unset( $query_string['name'] ); } } } return $query_string; }
add_filter('request', 'wphelp_custom_request'); 我已经使用了这个代码,现在它帮了我的忙。
https://wordpress.stackexchange.com/questions/405612
复制相似问题