Speedup WordPressExtra ShortcodesDonateGitHub
Plugin adds "Extra shortcodes": [bloginfo show="name"], [site_title], [site_desc], [site_url], [date format="Y-m-d"], [time], [year], [month], [month_name], [day], [weekday].
[bloginfo show="name"]
- bloginfo params;[site_name]
- Name of the site;[site_desc]
- Description of the site;[site_url]
- http://site.url;[wp_version]
- 3.3.1 (WordPress version);[date format="Y-m-d"]
- php date format params;[date format="F" timestamp="+1 months"]
- April (on March);[date format="Y-m-d" timestamp="+25 days"]
- 2012-04-23 (on 2012-03-29);[date format="Y" timestamp="+1 years"]
- 2013 (on 2012);[time format="H:i:s"]
- php time format params;[year]
- 2012,[year plus="3"]
- 2015,[year minus="2"]
- 2010;[month]
- 3 (in march),[month plus="3"]
- 6,[month minus="2"]
- 1,[month plus="11"]
- 12 (12 is maximum and it is not looped by default),[month plus="11" loop="1"]
- 2 (14, but with loop it becomes 2=14-12);[month_name]
- March;[day]
- 8,[day plus="3"]
- 11,[day minus="2"]
- 6,[day plus="30"]
- 31 (31 is maximum number of days for current month and it is not looped by default),[day plus="30" loop="1"]
- 7 (38, but with loop it becomes 7=38-31);[weekday]
- Friday;[hours]
- 17;[minutes]
- 35;[seconds]
- 59;
hi there, there is a way to show the date in with the post was posted? i try that manually and is a really pain in the ass....
This is not possible to do with Extra-Shortcodes plugin.
Hi,
I need to show posts based on year posted, is there a short code for that?
Thanks
No, unfortunately there is no shortcode for that.
Can this take a date string and format it as a m/d/y ?
2016-8-12 20:00:00 --> 8/12/16
Try this shortcode:
[date format="d/m/Y"]
Hi,
I need to put the blog post day above the blog post month. Do you have a separate shortcode for post day and for post month?
Thank you!
Clare
Sorry, but Extra-shortcodes does not have shortcodes for post date. It has only shortcodes for current date.
Hi there,
Is there any shortcode to show which week it is? Like now it is week 13, that would be great if you could tell me how to do that!
Thanks
Try these shortcode: [date format="W"]
You may use other php params to show dynamic date parts.
Hello, very useful plugin, thank you. I have a question. How could I show the name if the day and the month in the language I want? Now it shows in english and I want in spanish. Greetings from Chile.
Try this shortcode: [date_i18n format="l jS \\of F Y h:i:s A" timestamp="+2 years +3 months -20 days -10 hours +30 minutes"]
Thank you very much for your quick reply!!
Love it - wish this had a Birthday feature - so you could define a date in the past and have WordPress / PHP calculate the number of years *since* that date.
Example:
In business for [birthday_year="2002"] years.
Renders as:
In business for 12 years.
Wow thats a good solution, thanks very much.
Use this code to display date
Don't see the code that you referred to.
I am like Kel, what is a solution to show number of years in business or such.
Like he suggested:
In business [code ] years.
Output as
In business 15 years.
I tried using the timestamp options using a timestamp="-1997" but it outputs 70 when it should be outputting 17 (INO). That business start year is 1997. Thanks
Plugin does not support such feature.
If it's helpful, I did ultimately find this plugging Age Calculator which does specifically do the Birthday style calculations - It's out of date, but still working. And doesn't try to do all of the other things that "Extra-shortcodes" can do.
Hi, your extension Extra-Shortcode is wonderful, but there is a trouble... if I switch from "Source editor mode" into "HTML Viewer mode", my Shortcodes are automatically modified and break my links :(
Please, can you fix this ?
Thanks!
Sorry, but I don't know right now how to fix it.
Maybe I will find out in future and this will be fixed in next releases of the plugin.
I hope you find a solution to this very quickly, because it is very disabling :(
I tried to add something in "function.php" but it doesn't work...
All is stripped :(
oh my god thank you! All afternoon I've been trying to mess with php code to get something working on my site and just 5 mins after downloading this plugin my problem is solved! Where's the donate button!
You are welcome. I am glad that this plugin helped you. Here is the donate page.
How can I have the "month_name plus 1" so instead of it showing the current month name 'March' it shows 'April'
Thanks
Update your "Extra-shortcodes" plugin to version 1.2
and try this shortcode:
[month_name plus="2"]
You may also use this shortcode:
[date format="l jS \\of F Y h:i:s A" timestamp="+2 years +3 months -20 days -10 hours +30 minutes"]
How to set the time zone? Now it always uses GMT
In Extra-shortcodes plugin there is no way to set timezone.
You may set timezone with php in functions.php.
Hello Arjan, if you go to WordPress Settings > General > Timezone to set the timezone, this lets Extra-shortcodes know what local time is. Great Plugin, Thanks!!
Any chance you can do this to make sure the timezone is getting read correctly?
before everything
date_default_timezone_set( get_option( 'timezone_string' ) );
and
set it back
date_default_timezone_set(@date_default_timezone_get());
get_option( 'timezone_string' ); - returns empty string and this option is empty in database.
date_default_timezone_set( get_option( 'timezone_string' ) ); - throw an error.
What I am making wrong?
I use WordPress 3.8.1 and enabled debug mode.
As far as I know by default it should be UTC by default unless the user has set that in their admin. Maybe the code I wrote above is not foolproof and you would have to test if the timezone_string is infact set, if it is then do the date_default_timezone_set. Basically if I didn't do the above I had all my times in the timezone of the computer not the time I'd set in my wordpress admin.
I updated Extra-shortcodes plugin and added new param: [date format="h:i:s A" use_wordpress_timezone="1"] to [date] shortcode
Thank you, I tested it out and it seems to work nicely.
Hello.
Thanks for support! Nice plugin!
How can i show [date format="h:i:s A" use_wordpress_timezone="1"] in 24 hours format?
Thanks
You may try to use this shortcode:
[date format="H:i:s A" use_wordpress_timezone="1"]