Title: List short code with variables
Last modified: March 3, 2022

---

# List short code with variables

 *  [Christian Lomsdalen](https://wordpress.org/support/users/lomsdalen/)
 * (@lomsdalen)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/list-short-code-with-variables/)
 * I am going to use the same list many times, because I am display a list of posts,
   and I would like it to be “tabbed” per year to make it easier to display. Is 
   it possible to have the short code contain a variable? In my case it would be
   so get just the post in a certain year
 * In my mind it would look something like this
    `[postlist id=1270 date=year("2020")]`
    -  This topic was modified 4 years, 3 months ago by [Christian Lomsdalen](https://wordpress.org/support/users/lomsdalen/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flist-short-code-with-variables%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘List short code with variables’ is closed to new replies.

 * ![](https://ps.w.org/w4-post-list/assets/icon-128x128.png?rev=3034626)
 * [W4 Post List](https://wordpress.org/plugins/w4-post-list/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w4-post-list/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w4-post-list/)
 * [Active Topics](https://wordpress.org/support/plugin/w4-post-list/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w4-post-list/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w4-post-list/reviews/)

## Tags

 * [Short Code](https://wordpress.org/support/topic-tag/short-code/)
 * [variables](https://wordpress.org/support/topic-tag/variables/)

 * 0 replies
 * 0 participants
 * Last reply from: [Christian Lomsdalen](https://wordpress.org/support/users/lomsdalen/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/list-short-code-with-variables/)
 * Status: not resolved