Link in the_content changes post ID
-
Hello,
for quite some time I have the problem, that as soon as I have a link to another WordPress post/page in my posts, the post ID seems to change to that link (means it displays edit link and comments of the linked post). What could possibly be the reason?this is my content.php post
<div class="entry-content"> <article id="post-<?php the_ID(); ?>" <?php post_class();?>> <header class="article-header"> <h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> </header> <?php if ( has_post_thumbnail()) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail('small'); ?> </a> <?php endif; ?> <?php if ( is_page(tattoos)) : include ('tattoos.php');?> <?php endif; ?> <?php #echo get_the_ID(); ?> <?php the_content(); ?> <?php #echo get_the_ID(); ?> <footer class="article-footer"> <div class="meta"> <span class="date"><i class="fa fa-calendar"></i> <?php the_time('F j, Y'); ?></span> <span class="author"> <i class="fa fa-pencil"></i> <?php the_author_meta('nickname'); ?> <?php edit_post_link(__(' <i class="fa fa-pencil-square-o"></i> Edit', 'inspirat')); ?></span> <span class="footer-category"><span class="comments"> <i class="fa fa-comment"></i> <a href="<?php the_permalink(); ?>#comments"><?php comments_number('No Comments', '1 Comment', '% Comments'); ?></a> </span> <?php if (has_category( '',$post->ID)) { ?><i class="fa fa-folder-open"> </i> <?php the_category( ', '); ?> <?php } ?> <?php if (has_tag( '',$post->ID)) { ?><i class="fa fa-tags"> </i> <?php the_tags(); ?> <?php } ?> </span> </div> </footer> </article> </div>In this case, the first “echo get_the_ID()” would display 758139, the second 1740 if I have a link to post 1740 anywhere in the content.
Any ideas?
Thanks very much, Martina.
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Link in the_content changes post ID’ is closed to new replies.