I'm trying to customise the Clean Blog template to make a loose magazine-style layout. I want to have a different look on the home page than subsequent pages. Specifically, the home page would have 7 post previews, with the most recent larger than the others. On the following pages, I'd have 9 evenly sized previews.
I can achieve the look I want on the home page using article:first-of-type in my CSS file, but I don't know how to use it only on that page and not following pages. Is there a way to do this? Would I have to call a separate CSS file just for the home page, and if so, how would I do so?
Also, how would I display 7 entries on the home page, and 9 entries on the other pages?
Different CSS, and number of entries, on home page
Re: Different CSS, and number of entries, on home page
I'm not entirely sure if this is possible in s9y at all. If it is, it requires a customized index page, which requires you to create a copy of clean-blog and modify that (we call that "forking the theme") because clean-blog is part of the s9y core. Thus, your changes to clean-blog would be overwritten in case of an update.
Why not just set the number of posts (you can do that in the backend in configuration) to a number of entries teasers that's the same for any page? (I also suspect that a different number of entries would mess with archives, but that's just a vague theory.)
Usually, you would add a class to <body>, but only on the index page. So, in your index.tpl you'd useChristine wrote: ↑Mon Feb 11, 2019 10:41 amI can achieve the look I want on the home page using article:first-of-type in my CSS file, but I don't know how to use it only on that page and not following pages. Is there a way to do this? Would I have to call a separate CSS file just for the home page, and if so, how would I do so?
Code: Select all
<body{if $view == "start" && $staticpage_pagetitle == ''} class="home"{/if}>
This is, of course, also something which would require you to fork clean-blog to your own custom theme. If you need help with that, I can explain that later.
YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)
Re: Different CSS, and number of entries, on home page
The main reason was to make the newest or a featured post prominent and large on the first page, which wouldn't really make sense on subsequent pages. But I could probably do a workaround where it's the same number of posts, but arranged differently. Thanks for the tip on the archives; that would be a pain.yellowled wrote: ↑Mon Feb 11, 2019 2:19 pmWhy not just set the number of posts (you can do that in the backend in configuration) to a number of entries teasers that's the same for any page? (I also suspect that a different number of entries would mess with archives, but that's just a vague theory.)
Brilliant! I didn't think of that, but that's perfect. Thanks

I copied the template folder to a new one called clean-blog_mod, and changed the name in info.txt to Clean Blog Mod. Is there anything else I need to do?
I have another question, but let me know if it's better suited to another section of the forum. I'd like my readers to be able to switch between two themes - the new one I'm working on, and the old (current) one. I know there's the dropdown theme switch plugin, but I'd like to have a simple button or link that lets you change to the other theme. Is this possible?
Re: Different CSS, and number of entries, on home page
Nope, that's it. Great!

I'm not at all familiar with the theme switcher, but I assume it is. Try asking this again in the plugins forum, maybe the other guys can help you out.
YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)