I’ve tried this code to no avail:
//* Shortcode to display the current year in WordPress
//* shortcode: [year]
add_shortcode( 'year' , 'current_year' );
function current_year() {
$year = date("Y");
return "$year";
}
//* Activate shortcode function in Post Title
add_filter( 'the_title', 'do_shortcode' );
I’m thinking it might in conflict with another custom code to display the title in a page hero:
function my_custom_page_hero() {
// Check if it's not the homepage
if (!is_front_page()) {
// Output page or post title and post meta
add_action('generate_after_header', function() {
?>
<div class="page-hero">
<div class="container">
<h1><?php
if (is_category()) {
single_cat_title();
} elseif (is_author()) {
the_author();
} else {
echo get_the_title();
}
?></h1>
Is there a way to fix this?
]]>I just wanted to take a moment to express my sincere appreciation for the amazing plugin you have created. It has truly been a game-changer for me and has made it so much easier to keep my content up to date.
The features of the plugin are innovative and well-implemented, and it has saved me a significant amount of time and effort. I am constantly impressed by the thought and care that has gone into its development.
Thank you for all of your hard work and for creating such a valuable tool. Your efforts are truly appreciated and have made a positive difference in my work. Keep up the great work!
Sincerely,
Ehtsham Ul Hassan
Can anyone guide me on how to style the “WP Date and Time Shortcode” plugin?
The output display of date and time is very small in size, I need to get it bigger and bolder.
Thanks
]]>I use RSVP Maker to send out information about forthcoming walks and the RSVP is simply Yes or No. I don’t need the “mailing address” information as we don’t have one but if it has to be there so be it.
The main issue is the “Current Year” is not being displayed in the follow up emails. I get this:
Copyright (C) *|CURRENT_YEAR|Fleckney Walking Club All rights reserved.
How can I correct or remove this information from the follow up emails?
Regards,
RottenSod.
Is there a way to show dynamic text in Step 2? All I need is to show current year. I tried to add the following code into functions.php and use [year] in Step 2 but it doesn’t work (it shows ‘[year]’ instead of ‘2022’).
function year_shortcode () {
$year = date(‘Y’);
return $year;
}
add_shortcode (‘year’, ‘year_shortcode’);`
Any ideas?
Thank you,
Jack
<?= date('Y'); ?>
) in Footer Credit Content > Footer Text ?
]]>