Assign a link of a post to that contains that post?

I’m trying to figure out how can I assign the link of each post to every item that contains it. I would like to click on so I can go to the post page that the was containing.

Here is the item I’m talking about (it’s in the content.php file):

<?php
/**
* Template part for displaying posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package meptheme
*/

?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<header class=”entry-header”>
<?php
if ( is_singular() ) :
the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ );
else :
the_title( ‘<h2 class=”entry-title”><a href=”‘ . esc_url( get_permalink() ) . ‘” rel=”bookmark”>’, ‘</a></h2>’ );
endif;

if ( ‘post’ === get_post_type() ) : ?>
<div class=”entry-meta”>
<?php meptheme_posted_on(); ?>
</div><!– .entry-meta –>
<?php
endif; ?>
</header><!– .entry-header –>

<div class=”entry-content”>
<?php
the_content( sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( ‘Continue reading<span class=”screen-reader-text”> “%s”</span>’, ‘meptheme’ ),
array(
‘span’ => array(
‘class’ => array(),
),
)
),
get_the_title()
) );

wp_link_pages( array(
‘before’ => ‘<div class=”page-links”>’ . esc_html__( ‘Pages:’, ‘meptheme’ ),
‘after’ => ‘</div>’,
) );
?>
</div><!– .entry-content –>

<footer class=”entry-footer”>
<?php meptheme_entry_footer(); ?>
</footer><!– .entry-footer –>
</article><!– #post-<?php the_ID(); ?> –>

Here is the example: I’m on this page http://nuovomep.altervista.org/m-49
I would like to click on the first and get addressed to http://nuovomep.altervista.org/m-49/26341

The tag on line 17 contains the correct link: ‘, ‘

Read more here:: <a href=https://wordpress.stackexchange.com/questions/296554/assign-a-link-of-a-post-to-article-that-contains-that-post target="_blank" title="Assign a link of a post to

that contains that post?” rel=nofollow>Assign a link of a post to

that contains that post?

Leave a Reply

Your email address will not be published. Required fields are marked *