I am running the following code on Wordpress:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li><?php the_permalink() ?>,<?php the_ID() ?></li>
<?php endwhile; endif; ?>
But it is returning an incorrect URL. For instance, one post may return:
/disastersafety/last-minute-actions-flooding-imminent/
However, when clicked, that URL actually is
/ibhs/ibhs-risks/ibhs-risk-flood/last-minute-actions-flooding-imminent/
How can I get Wordpress to echo the actual correct URL?