Jump to content
Sign in to follow this  
justinroffmarsh

How to distinguish between full post and magazine-style clips

Recommended Posts

justinroffmarsh

On my home page (blog) I show one full post and a set of magazine-style clips. I use the following custom code to hide excerpts for post 1 and show them for the rest. .blog .post-number-1 .post-excerpt { display: none; } .blog .clip_box .entry_wrap {display:none;} However, if I follow the previous-post link, I go to a page with nothing but clips -- and the first of these is missing an excerpt. How do I modify line-1 so it applies just to full posts or just to the most -recent post or something that accomplishes the same? Justin

Share this post


Link to post
Share on other sites
Jenny
If I understand you correctly, try adding .archive in place of .blog (both lines). If it doesn't work you can always switch it back. :)

Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites
justinroffmarsh
Sorry simple_mama; doesn't work! I guess I need to limit the change to either: (a) The home page (b) The most recent post Justin

Share this post


Link to post
Share on other sites
justinroffmarsh
BTW, substituting .blog with .archive, stopped both lines of code working on all pages. I also tried substituting .blog with .home and they both work exactly the same.

Share this post


Link to post
Share on other sites
kastelic
Once you start clicking "previous posts" there are a couple classes added to the body tag which will let you target and fix your problem, "paged" and "paged-x" (x being the number of pages back from the homepage.) So you could do something like this: [code].blog .post-number-1 .post-excerpt { display: none; } .blog .clip_box .entry_wrap {display:none;} .paged .blog .post-number-1 .post-excerpt { display: block; } .paged .blog .clip_box .entry_wrap {display:block;}[/code]

Share this post


Link to post
Share on other sites
justinroffmarsh
Kastelic I'm afraid that doesn't work either. If you follow this link you can see what the previous pages look like (contrast them with the home page, which works great). http://www.sandbox.salesprocessengineering.net/page/2/ This site is about to go into production, btw, so if you're not seeing a prominent illustration of a person, then try the URL without "sandbox". Justin

Share this post


Link to post
Share on other sites
kastelic
Sorry I had the classes seperated by a space but they are both on the 'body' element so they should be joined like this: [code] .paged.blog .post-number-1 .post-excerpt { display: block; } .paged.blog .clip_box .entry_wrap {display:block;} [/code]

Share this post


Link to post
Share on other sites
justinroffmarsh
Kastelic That doesn't work either. It results in the clips appearing as full posts! My site is now live at www.salesprocessengineering.net Justin

Share this post


Link to post
Share on other sites
justinroffmarsh
Actually, to be correct, it works find on the home page, but on 'previous' pages it causes the first two clips to appear fine, and the balance to appear as full articles. Justin

Share this post


Link to post
Share on other sites
justinroffmarsh
Oh, but I've fixed it already! The last line just needed to be: .paged.blog .clip_box .entry_wrap {display:none;} Thanks heaps Justin

Share this post


Link to post
Share on other sites
Rob
Very happy you resolved that Justin!

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×