Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Jhon-mantila/pluging-wordpress/llms.txt

Use this file to discover all available pages before exploring further.

The categorias_grid shortcode renders a responsive CSS grid of WordPress categories. Each category is displayed as a full-bleed card whose background is the featured image of that category’s most recent published post. A gradient overlay sits on top of the image, anchoring the category name and total post count to the bottom of the card. Categories are ordered by post count from highest to lowest by default. If no post in a category has a featured image, a placeholder image is used as the background. The grid collapses to a single column on screens 768 px wide or narrower. All styles are injected inline via the wp_head action hook — no separate stylesheet is enqueued.

Basic Usage

[categorias_grid]

Parameters

number
integer
default:"0"
Number of categories to display. 0 retrieves all available categories. When a positive integer is supplied, only the top N categories (by post count) are shown.
columns
integer
default:"3"
Number of columns in the grid (valid range: 16). The value is applied directly as grid-template-columns: repeat(N, 1fr) via an inline style on the container. This inline style is overridden on small screens by a !important media query that forces a single column.
hide_empty
boolean
default:"true"
Whether to exclude categories that have no published posts. Set to "false" to show categories with zero posts (useful when you want to preview a site’s full taxonomy structure).

Examples

[categorias_grid]

CSS Classes Reference

ClassDescription
.grid-categoriasGrid container element. Receives an inline style attribute with the grid-template-columns value derived from the columns parameter. Also sets display: grid, gap: 20px, and margin: 20px 0.
.categoria-itemEach category card — an <a> tag linking to the category archive. Receives an inline style attribute with the background-image URL. Fixed height of 250 px, rounded corners (border-radius: 12px), and a bottom-to-top box shadow for depth.
.categoria-item .overlayGradient overlay rendered as an absolutely-positioned child of .categoria-item. Contains the <h2> category name and a <span> with the post count in the format N artículos. The overlay deepens on :hover.

Performance Note

Each category in the grid triggers one additional WP_Query call to retrieve the featured image URL of that category’s most recent post. On sites with a large number of categories, this can result in many database queries per page load. Use the number parameter to limit the rendered categories (e.g., number="6") and consider adding a page-level caching layer if the shortcode is used on a high-traffic page.

Build docs developers (and LLMs) love