I’m having some difficulty here, and I’m sure there’s an easy solution I’m overlooking.
I utilize ‘sticky’ posts from time to time—like most folks—and have an {if sticky=='y'} statement to add in an extra line of content for that sticky post (mainly a note that the entry is sticky and to scroll down for new content) that shows up only when an entry is sticky.
What I’d like to change is to have the sticky post in a different format. I can easily do this using the {if}, but it then duplicates the entry with the sticky format at the top and then again at the top of the regular weblog entries.
Is there a way to exclude sticky posts from showing in exp:weblog:entries?
I’m using using 1.6.9 build 2010430.
Here’s the code I’m currently using:
{exp:weblog:entries weblog="{my_weblog}" show_expired="yes" orderby="date" sort="desc" limit="15" parse="inward"}
<div class="regular">
{date_heading}
{entry_date format=' %l, %F %d, %Y '}
{/date_heading}
{title}
{if summary != ""}
{summary}
{/if}
{body}
{if extended != ""}
<i><a href="http://{comment_url_title_auto_path}#more">Read more…</a></i>
{/if}
{if sticky=='y'} <i>This post is 'sticky.' Scroll down for new content.</i> {/if}
{author} {entry_date format='%h:%i %A'} |
{if forum_topic}
<a href="http://{path=forums/viewthread}{forum_topic_id}">Discuss on the forums</a>
{/if}
{if allow_comments}
({comment_total}) <a href="http://{url_title_path=">Comments</a>
{/if}
| <a href="http://{permalink=site/friend}">Email this post</a>
| <a href="http://{title_permalink={my_template_group}/index}">Permalink</a>
| {if allow_trackbacks}({trackback_total}) <a href="http://{trackback_path=">Trackbacks</a>{/if}
</div>
{paginate}
<div class="paginate">
<span class="pagecount">
Page {current_page} of {total_pages} pages
</span>
{pagination_links}
</div>
{/paginate}
</div>
{/exp:weblog:entries}{exp:weblog:entries weblog="{my_weblog}" show_expired="yes" orderby="date" sort="desc" limit="15" parse="inward"}
{if sticky=='y'}<div class="sticky"> {title}
{if summary != ""}
{summary}
{/if}
{body}
{if extended != ""}
<i><a href="http://{comment_url_title_auto_path}#more">Read more…</a></i>
{/if}
{author} {entry_date format='%h:%i %A'} |
{if forum_topic}
<a href="http://{path=forums/viewthread}{forum_topic_id}">Discuss on the forums</a>
{/if}
{if allow_comments}
({comment_total}) <a href="http://{url_title_path=">Comments</a>
{/if}
<i>This post is 'sticky.' Scroll down for new content.</i>
</div>
{/if}
<div class="regular">
{date_heading}
{entry_date format=' %l, %F %d, %Y '}
{/date_heading}
{title}
{if summary != ""}
{summary}
{/if}
{body}
{if extended != ""}
<i><a href="http://{comment_url_title_auto_path}#more">Read more…</a></i>
{/if}
{author} {entry_date format='%h:%i %A'} |
{if forum_topic}
<a href="http://{path=forums/viewthread}{forum_topic_id}">Discuss on the forums</a>
{/if}
{if allow_comments}
({comment_total}) <a href="http://{url_title_path=">Comments</a>
{/if}
| <a href="http://{permalink=site/friend}">Email this post</a>
| <a href="http://{title_permalink={my_template_group}/index}">Permalink</a>
| {if allow_trackbacks}({trackback_total}) <a href="http://{trackback_path=">Trackbacks</a>{/if}
</div>
{paginate}
<div class="paginate">
<span class="pagecount">
Page {current_page} of {total_pages} pages
</span>
{pagination_links}
</div>
{/paginate}
</div>
{/exp:weblog:entries}