This project is read-only.

Hide unpublished posts from the main blog area

Topics: Themes
Aug 20, 2014 at 2:44 PM
What code would I need to change to make unpublished posts not appear in the main blog, or where would I add a style to denote a post as unpublished (add a border or some other distinguishing factor)? I'm adept enough to make the changes, but don't understand the inner workings of BE to figure it out for myself.

I saw that I could edit the "Editor" role, but then the editors couldn't see their own draft posts either.

I found a link but it appears to be code from an older version of BE.
Aug 20, 2014 at 8:16 PM
Are you saying that when you log off you still can see unpublished posts? Because if you can see drafts in the admin, you should also see them in the blog.
Aug 21, 2014 at 1:56 PM
No, when logged off we don't see the posts. However, we have 7 people posting (Editors), and they find it confusing to see the draft posts in the main blog feed. So is there a way to add a class to an unpublished post so I could make them look a little different or can I hide them from the main feed and only let them be visible to the editors (and even administrators) in the dashboard area?
Aug 21, 2014 at 3:31 PM
You can add CSS class in your theme to make draft look different. Inside PostView.ascx, use code similar to this:
<article class="post">
<%} else {%>
<article class="draft">
Point is, inside this control "Post" is a currently loaded post and you can use any properties including "IsPublished" to manipulate HTML inside template.