Anyway to change post #1 url to include /#post-___ ?

John917

Active member
3aCPs.jpg


The numbers #2 and #3 hyperlink urls like (http://www.website.com/forums/threads/threadtitle.1063/#post-1943).

However post number 1 just shows a link without the #post-___ like (http://www.website.com/forums/threads/threadtitle.1063).

Is there a template modification where I can have the post # integrated to the first post hyperlink?
 
Open template "post"
Find:
HTML:
<a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="item muted postNumber hashPermalink OverlayTrigger" data-href="{xen:link posts/permalink, $post}">#{xen:calc '{$post.position} + 1'}</a>
Replace with
Code:
<xen:if is="{$post.position} == 0">
      <a href="{xen:link threads, $thread}#post-{$post.post_id}" title="{xen:phrase permalink}" class="item muted postNumber hashPermalink OverlayTrigger" data-href="{xen:link posts/permalink, $post}">#{xen:calc '{$post.position} + 1'}</a>
      <xen:else />
      <a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="item muted postNumber hashPermalink OverlayTrigger" data-href="{xen:link posts/permalink, $post}">#{xen:calc '{$post.position} + 1'}</a>
      </xen:if>
 
Back
Top Bottom