Skip to content

Add shortcode article limit with “View all” overflow link#290

Draft
Copilot wants to merge 3 commits intodevelopfrom
copilot/limit-articles-display
Draft

Add shortcode article limit with “View all” overflow link#290
Copilot wants to merge 3 commits intodevelopfrom
copilot/limit-articles-display

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Index page needs a way to cap articles shown per doc section while allowing expansion.

  • Changes

    • Added articles shortcode attribute and plumbed value into template rendering.
    • Switched section article fetch to WP_Query with posts_per_page = limit + 1 to detect overflow efficiently.
    • Appended “View all” link when more articles exist; added minimal styling and rel="noopener noreferrer" on outbound links.
  • Example

    // Show up to 3 articles per section on the [wedocs] index
    echo do_shortcode( '[wedocs articles="3"]' );
Original prompt

This section details on the original issue you should resolve

<issue_title>Feature Request - Limit Number of Articles Displayed on Document index page</issue_title>
<issue_description>Hi @tareq1988

Can there be a setting or shortcode parameter that allows you specify the maximum number of articles to display per doc?

For instance, if I have Doc A (with 5 articles) and Doc B (with 7 articles); and I specify say 3 as maximum number of articles, it displays not more than 3 articles each under Doc A and Doc B on the index page, then there can be a View all button to expand the list if there are more articles.

I hope this clarifies :-)
</issue_description>

<agent_instructions>Add pagination support on the wedocs shortcode will have good user experience</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@Rubaiyat-E-Mohammad I do not think this feature will add any significant value to the plugin. Please have a look. @anik-fahmid vai

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 31, 2026 12:17
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Co-authored-by: iftakharul-islam <88052038+iftakharul-islam@users.noreply.github.com>
Copilot AI changed the title [WIP] Add setting to limit number of articles displayed on index page Add shortcode article limit with “View all” overflow link Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request - Limit Number of Articles Displayed on Document index page

2 participants