Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
531 B
1
Indexable
Never
<?php
if (have_posts()) {
    while (have_posts()) {
        the_post();
        $post_id = get_the_ID();
        $permalink = get_permalink($post_id);

        if ($permalink) {
            $current_language = apply_filters( 'wpml_current_language', NULL );
            $post_link = apply_filters( 'wpml_permalink', $permalink, $current_language, true );

            echo "Current Post ID: $post_id<br>";
            echo "Modified Permalink: $post_link";
        } else {
            echo "Post not found.";
        }
    }
}
?>