wp_back/wp-content/themes/pampadutheme/main-page.php

38 lines
703 B
PHP
Raw Permalink Normal View History

2024-05-20 15:37:46 +03:00
<?php
//Template Name: Blog
//
//
get_header();
$current = !empty( $_GET['PAGEN'] ) ? $_GET['PAGEN'] : 1;
$query = new WP_Query(
[
'post_type' => 'post',
'posts_per_page' => 3,
'paged' => $current,
]
);
$myposts = get_posts( array(
'posts_per_page' => 3,
'paged' => $current,
) );
foreach( $myposts as $post ){
setup_postdata( $post );
the_title();
echo '<br>';
}
wp_reset_postdata();
echo wp_kses_post(
paginate_links(
[
'total' => $query->max_num_pages,
'current' => $current,
'format' => '?PAGEN=%#%',
'base' => site_url() . '%_%',
]
)
);
get_footer(); ?>