Standard wordpress code, content code page.php. Permanent links: /%post_type%/%postname%/ When replaced with "Simple" or any other type of links, nothing changes, htaccess is standard. The problem of this nature: if you open a page with the code below, it will produce "Nothing Found", and if you uncomment the first have_posts(); then the content is displayed. And so with all pages and entries, except the main page. It turns out that have_posts works as expected from 2 times (although the content is available). What can it be and how to fix it? Can anyone come across?
<?php get_header(); ?> <?php //have_posts(); ?> <?php if (have_posts()): ?> <?php while (have_posts()): ?> <?php the_post(); ?> <?php get_template_part('template-parts/content', 'page'); ?> <?php if (comments_open() || get_comments_number()) : ?> <?php comments_template(); ?> <?php endif; ?> <?php endwhile; ?> <?php else: ?> <?php get_template_part('template-parts/content', 'none'); ?> <?php endif; ?> <?php get_footer(); ?>