Tips & TricksWordPress

How to add dynamic content in WordPress post?

I have developed a plugin to display dynamic content on WordPress post just by setting values from the WP Editor area.

Learn how to add dynamic post content in a WordPress blog.


This method can help to automate your blog content.

How to add dynamic content in WordPress post?

Example: Suppose a blog post contains “2015” as the value (say).

Now, it should be displayed as “4” in the year 2019 (i.e. 2019-2015 = 4) and that of  “5” in 2020 (i.e. 2020-2015 = 5).

In other words, the final number (result printed) is the total duration from the current year to the value set.

I have checked and implemented the solution for the above example.

From Year: 2015

To Current Year: [year]

Result/Duration:  [rxpnum targetyear=2015]

From Year: 2016

To Current Year: [year]

Result/Duration:  [rxpnum targetyear=2016]

From Year: 2017

To Current Year: [year]

Result/Duration:  [rxpnum targetyear=2017]

From Year: 2018

To Current Year: [year]

Result/Duration:  [rxpnum targetyear=2018]


Rabins Sharma Lamichhane

Rabins Sharma Lamichhane is the owner of RabinsXP who is constantly working for increasing the Internet of Things (IoT) in Nepal. He also builds android apps and crafts beautiful websites. He is also working with various social services. The main aim of Lamichhane is to digitally empower the citizens of Nepal and make the world spiritually sound better both in terms of technology and personal development. Rabins is also the first initiator of Digital Nepal.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button

Adblock Detected

Please disable Adblock to have a smooth experience.