If you find yourself typing the same parameters over and over, you can save time by changing the default attributes. These can always be overridden by specifying new attributes on an individual shortcode.
For instance, let’s say you always list 20 posts with excerpts:
[display-posts include_excerpt="true" posts_per_page="20"]
We can use the following to set these as the default:
This code snippet goes in a core functionality plugin or Code Snippets.
Now we can get the same result without having to specify the attribute:
[display-posts]
And if we want to use different settings on a page, we can use the parameters to override the default:
[display-posts include_excerpt="false" posts_per_page="5"]
Filters used:
shortcode_atts_display-posts