I have created a custom view within Site pages that filters only pages that have been created the last 14 days and is working fine.

However, I now need to display this on a SharePoint online page (This is a news site, so I need to display the last 14 days worth of news posted).

I have tried with Highlighted Content web part but couldn't find the way around it.

Anyone know if there is a way of doing that by maybe using a custom query?

1 Answer 1


You can use Document Library web part for this requirements.

Follow the steps:

  1. Go to your SharePoint modern site page

  2. Open the page in edit mode

  3. Add document library web part on the page:

    enter image description here

  4. Select "Site Pages" library in the web part:

    enter image description here

  5. Select the required view to show ("This Month" in my case) and other web part properties as per your requirements and publish/republish the page:

    enter image description here

  • Thank you, Is there a way of doing this with Highlighted content as this is for News posts and will need to display the news and not in a list view?
    – Chris
    Commented Jan 23 at 11:18
  • Not sure if you will be able to use the custom query in HCWP based on "view", you will have to add all the filters you applied in view settings as query in HCWP. Any problem while using SharePoint default News web part to show the recently created news posts? Commented Jan 23 at 11:28
  • Yes so i tried News Web part but wasn't able to get what i wanted unless you have any instructions on how to do so. What i need is to display the last 7 days worth of news on one webpart and 14 days worth of News on another webpart. The only option I thought of working was by creating a custom view in Site pages and then surfacing that somehow. But open to any other option using the News web part
    – Chris
    Commented Jan 23 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.