WP Media Library Front-end Gallery

Using a WordPress loop to pull images directly from the WordPress Media Library and displaying them with a shortcode.

A crucial part of filtering the images you want to show from the rest of what is in your media library is done by attaching a taxonomy to the media library items. This has the added benefit of creating the foundation needed to allow for filtering of the gallery on the front end as well.

Filterable Gallery that pulls images straight from the media library

Read moreWP Media Library Front-end Gallery

Shortcode & Autop

I have a little WordPress plugin I use on some of my sites and it employs shortcodes. The shortcodes are not self-closing and they are wrapped in more shortcodes. They’re nested shortcodes. Using them looks like this:

[ltabjes talen="Taal Language"][ltab taal="Taal"]

Content

[/ltab][ltab taal="Language"]

More content

[/ltab][/ltabjes]

WordPress wraps p-tags around each of these shortcode tags, and adds more p-tags inside the shortcodes, adding more space than is wanted. All those empty p-tags are a drag. The shortcode_unautop function removes the outer paragraph tags, but not the inner ones. I don’t want to remove wpautop altogether because the content in the shortcode might still need it. How to solve this?

Read moreShortcode & Autop