Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 586|回复: 0

Here is the function

[复制链接]

2

主题

2

帖子

10

积分

新手上路

积分
10
发表于 2024-4-30 00:45:49 | 显示全部楼层 |阅读模式

The best course of action for you would be to create and add a custom plugin to your website to add this shortcode. While you can add shortcodes to your theme, if you're publishing your site with an AMP plugin, those shortcodes won't render. If you add them to your own plugin, they will render on AMP pages.

Click : UK mobile number database




The function will subtract the current year from the year you pass, or use the date you enter in this code as the default. In this case, I used the date of the first published post on Martech Zone.

Get More Info click here :

Martech Zone has been published for over 18 years!

This shortcode will calculate the number of years from this date. As an example, if I wanted to write how many years ago my birthday was, I would write:

The result is:

Douglas Carr is 55 years old!

Of course, you can get a lot more complicated with this type of shortcode... you can use HTML, images, CSS, etc., but this is just a simple example of how to make sure your site is already accurate!

How to wrap it in your own plugin
I would recommend creating a custom plugin for your website that will include all your shortcodes, even the ones included in your theme. Do this:

Create a folder with a unique name. For example, ours is called mtz-shortcodes.


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2024-9-20 19:53 , Processed in 0.031250 second(s), 18 queries .

Powered by Discuz! X3.5

Copyright © 2001-2022 Tencent Cloud.

快速回复 返回顶部 返回列表