Title: [Plugin:Infinite-Scroll] &#039;Breaks&#039; permalink
Last modified: August 21, 2016

---

# [Plugin:Infinite-Scroll] 'Breaks' permalink

 *  Resolved [jacob0601](https://wordpress.org/support/users/jacob0601/)
 * (@jacob0601)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugininfinite-scroll-breaks-permalink/)
 * I am not sure I would say it breaks them exactly, but any new posts that load
   via infinite scroll, the permalinks get messed up. I am doing this all locally
   for the time being so I can not link to a site, but I can included the behavior
   here in the post.
 * This is the code I have for each post on the front page (that are being loaded
   via infinite-scroll):
 *     ```
       <div class="preview_image">
       	<div class="preview_data">
       		<?php $category = get_the_category(); ?>
       		<div class="post-categories"><a href="<?php echo get_category_link($category[0]->cat_ID); ?>"><?php echo $category[0]->cat_name; ?></a></div>
       		<p class="archive_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
       		<div class="clearer"></div>
       	</div>
       	<a href="<?php the_permalink(); ?>" />
       	<?php echo get_preview_thumbnail(); ?>
       	</a>
       </div>
       ```
   
 * That above makes each preview thumbnail a clickable link to the single post and
   that works for every post that loads before infinite scroll loads any.
 * Once infinite scroll loads additional posts I can no longer click the images 
   to get the next posts. The archive_title is still clickable, but I would like
   to still be able to click the images.
 * Not sure why this is happening or if I am missing something but when inspecting
   the `<a>` elements, the ones that are loaded by infinite scroll are 0px by 0px
   and the ones that are originally loaded on the front page (not by I-S) have some
   size to them.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [jacob0601](https://wordpress.org/support/users/jacob0601/)
 * (@jacob0601)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugininfinite-scroll-breaks-permalink/#post-3823837)
 * I found something about what is going on.
 * So the original content loads with the preview_thumbnail _inside_ of the `a` 
   link, but any content that loads via infinite-loop is outside of the `a` link.
 * Original content:
 *     ```
       <a href="http://linkhere.com">
       <img width="300" height="150" src="http://imagehere.jpg" class="attachment-post-thumbnail wp-post-image" alt="">
       </a>
       ```
   
 * Infinite – scroll loaded:
 *     ```
       <a href="http://linkhere.com">
       </a>
       <img width="300" height="150" src="http://imagehere.jpg" class="attachment-post-thumbnail wp-post-image" alt="">
       ```
   
 * Not sure why this is happening:(
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugininfinite-scroll-breaks-permalink/#post-3823838)
 * This code in your post is wrong:
 *     ```
       <a href="<?php the_permalink(); ?>" />
       <?php echo get_preview_thumbnail(); ?>
       </a>
       ```
   
 * Notice that / at the end of the first line? That is a self-closing link. Links
   should not be self closing. Try removing that ending slash.
 *  Thread Starter [jacob0601](https://wordpress.org/support/users/jacob0601/)
 * (@jacob0601)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugininfinite-scroll-breaks-permalink/#post-3823839)
 * Holy crap; what a stupid mistake on my part; that is completely correct and fixed
   the issue right up. Sometimes another set of eyes just helps out so much.
 * **THANK YOU!!!**
 * I am having another slight issue as well, I will start a new topic about it though
   since it is different than this posting.
 * Again, thanks so much Otto.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin:Infinite-Scroll] 'Breaks' permalink’ is closed to new replies.

## Tags

 * [links](https://wordpress.org/support/topic-tag/links/)

 * 3 replies
 * 2 participants
 * Last reply from: [jacob0601](https://wordpress.org/support/users/jacob0601/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/plugininfinite-scroll-breaks-permalink/#post-3823839)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
