ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How do I show 1 Week of entries and only allow a maximum of 10 to show?

January 18, 2011 5:31pm

Subscribe [3]
  • #1 / Jan 18, 2011 5:31pm

    11Media

    157 posts

    Hi,

    I have a sidebar that says “Articles from this week” but I only want to show 10 entries… Not the whole weeks worth… (As it could be something crazy like 500 or sometimes I might only post 3 stories and don’t want the other weeks shown)

    The following doesn’t work…

    {exp:channel:entries channel="stories" display_by="week" limit="10"}

    Because this will show 10 weeks worth of stories!

    So how can I set a 10 entry limit and also use display_by=“week” ?

    Thanks.

  • #2 / Jan 18, 2011 5:42pm

    Ingmar

    29245 posts

    Why not just show the last 10 entries?

    {exp:channel:entries channel="stories" limit="10"}
  • #3 / Jan 18, 2011 5:49pm

    11Media

    157 posts

    Because I would like to show only 1 weeks worth please…

    Is this possible?


    Would it be a custom SQL query?

  • #4 / Jan 19, 2011 10:09am

    Sue Crocker

    26054 posts

    Do you want something like start on seven days ago, but limit to only ten entries?

  • #5 / Jan 19, 2011 10:12am

    11Media

    157 posts

    Hi Sue,

    Yes, please.

    For the whole previous 7 days… I want to limit it to just 10 entries…

  • #6 / Jan 20, 2011 3:14am

    Ingmar

    29245 posts

    In your case you might have to use the start_on parameter, perhaps with a line of PHP to calculate the offset automatically. Or, of course, a custom SQL query.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases