• This is what I’m trying to accomplish. I have a client who has me updated his site in several different areas with information like

    “name1 has been married to name2 for 31 years”.

    “name1 has worked for such-and-such organization for 16 years.”

    So, is there a way to just have the amount of years be a formula that would just increase by one each year. Like in excel how you can have a cell show the current date, or be equal to the amount of years from a certain date. I could be missing something simple, but I can’t figure it out. Maybe just something in html?

Viewing 1 replies (of 1 total)
  • Hi Brandon,
    You can do what you’re describing using some simple PHP code and a plugin to put the code into your page or post. One plugin you could try is PHP Code Snippets. The plugin creates a shortcode from your PHP code, then you can paste the shortcode into any page or post.

    An example of PHP code that will display the number 31 and increase by 1 every year is <?php echo year("Y") - 1984 ?>.

    Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘How to have auto-numeric calculations in text’ is closed to new replies.