I don’t know why, but I can’t navigate to post by click. I have tried get_permalink() and the_permalink() but changes only url. And i need to see only post that was pushed (alone) after click. Does anybody know what I’m doing wrong ?
<?php
$args = array(
'post_type'=> 'post'
);
$the_query = new WP_Query( $args );
// The Loop
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post(); ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><?php the_content(); ?></p>
<?php
}
}
?>
I don’t know why, but I can’t navigate to post by click. I have tried get_permalink() and the_permalink() but changes only url. And i need to see only post that was pushed (alone) after click. Does anybody know what I’m doing wrong ?
<?php
$args = array(
'post_type'=> 'post'
);
$the_query = new WP_Query( $args );
// The Loop
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post(); ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><?php the_content(); ?></p>
<?php
}
}
?>
Share
Improve this question
asked Nov 15, 2019 at 17:43
Maksym DomaretskyiMaksym Domaretskyi
1
1
- 2 Hi. In which file did you put this code? And how does your single.php look like? – Krzysiek Dróżdż Commented Nov 15, 2019 at 18:03
1 Answer
Reset to default 0Sometimes you need to just go to /wp-admin/options-permalink.php and resave your settings. It happens a lot with different hosts and it just needs to be resaved in my experience.