> For the complete documentation index, see [llms.txt](https://docs.probloggertemplates.com/guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.probloggertemplates.com/guides/smartmag/getting-started/trending-posts.md).

# Trending Posts

Access your blog **Layout** > and click on the **Add a Gadget** > **HTML/JavaScript** or **Popular Posts** > in the **Trending Posts** section.

### HTML/JavaScript&#x20;

Shortcode: `{getPosts} $label={Label Name} $results={Number of Results}`&#x20;

Label Name: `Custom Label`, `recent`&#x20;

Number of Results: The attribute `$results={}` is optional! Default is `5`.

The `$label={}` attribute is optional! The default value is `recent`.

**Example:**

<figure><img src="/files/wNaBCS58lXje0fMiutW2" alt="HTML/JavaScript" width="446"><figcaption></figcaption></figure>

### Popular Posts

<figure><img src="/files/MIDEmoFaV6lAuW3yeVAv" alt="Access your blog Layout > and click on the Add a Gadget > HTML/JavaScript or Popular Posts > in the Trending Posts section. HTML/JavaScript  Shortcode: {getPosts} $label={Label Name} $results={Number of Results}  Label Name: Custom Label, recent  Number of Results: The attribute $results={} is optional! Default is 5. The $label={} attribute is optional! The default value is recent. Example:  Popular Posts" width="441"><figcaption></figcaption></figure>
