• Resolved Scott

    (@scott_visionmedia)


    Hi there,

    Is it possible to have different styling for the second post onwards?

    So for example, the first post features an image and excerpt, and the second just the title.

    OR, is it possible to exclude the first post in a category (which would allow for separate styling).

    I’ve had a look and read about query_posts / showposts &offset1, etc and experimented to no avail, but I’m new to all this and it’s gone over my head to be honest!

    Hope this makes sense!

    Cheers.

    https://www.ads-software.com/plugins/posts-in-page/

Viewing 11 replies - 1 through 11 (of 11 total)
  • smitheringale

    (@smitheringale)

    This would be very useful for me as well actually. Been asked to do something similar – with a featured first post bigger and all other posts styles below as normal.

    Thread Starter Scott

    (@scott_visionmedia)

    I’ve solved this for myself.

    Found a different plug-in that used _offset=’x’_ so tried this in the shortcode and happily it works! With this addition I can place another shortcode below using a different template, thus solving the problem.

    So shortcodes reads:
    [ic_add_posts category=’Top1′ showposts=’1′ template=’posts_loop_topstory.php’]
    [ic_add_posts category=’Top1′ offset=’1′ showposts=’2′ template=’posts_loop_topstory-under.php’]

    Thread Starter Scott

    (@scott_visionmedia)

    (marked as resolved)

    which plugin did you use?

    This one seems to work. https://www.ads-software.com/plugins/list-category-posts/other_notes/

    add offset=”1″ (for example) to the shortcode. Just the ticket, I think.

    Thread Starter Scott

    (@scott_visionmedia)

    There’s no need for an extra plug in, sorry I should have been clearer.

    offset=’x’ will work fine in this plug in, it’s just not mentioned in the Read Me file.

    What’s offset? I was thinking a class needs to be assigned somehow if I had posts native styling created in another plugin instead of using the theme’s.

    Thread Starter Scott

    (@scott_visionmedia)

    offset=’x’ enables you to skip ‘x’ number of posts before the one that is shown, so for example:

    You have posts 1, 2, & 3, and you want the short code to start from the third post. To achieve this you would add offset=’2′ to the short code.

    You can apply a different layout and styling by creating separate posts_loop.php templates in your theme’s root folder, then use template=’y’ to use them.

    Hope I’ve covered what you wanted to know.

    Thanks! The answer I was looking for.

    But how can I now change the font-size/color for the title in post no 2?

    Thread Starter Scott

    (@scott_visionmedia)

    I think this is the answer for you Marco…

    Copy ‘posts_loop.php’ (the template used to display posts) from the plug in folder and place in your theme directory.

    You’ll need two of these, eg. ‘posts_loop_one.php’ & ‘posts_loop_two.php’.
    Style these files as required using inliine CSS or classes from your ‘style.css’ sheet.

    Your short codes for your two posts in different styles will look like this:

    Post no.1: [ic_add_posts category='X' showposts='1' template='posts_loop_one.php']

    Post no.2: [ic_add_posts category='X' offset='1' showposts='Y' template='posts_loop_two.php']

    Thanks! But how can I do to put a style=last for the last column? Any idea?
    I want to make a dinamic solution.
    Sorry for my english.
    Regards

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Different styling for posts after first / exclude first post’ is closed to new replies.