Shortcodes output in the wrong order

I have two shortcodes that i’m using for copyright information.

// Year shortcode
function year_shortcode() {
$year = the_time(‘Y’);
return $year;
}
add_shortcode( ‘year’, ‘year_shortcode’ );

// Copyright shortcode
function copyright_shortcode() {
$copyright = ‘©’;
return $copyright;
}
add_shortcode( ‘c’, ‘copyright_shortcode’ );

[c][year] Copyright info stuff here…

Returns 2018 © Copyright info stuff here…

I’m trying to add the © symbol as the first text element.

I’ve also tested with ob_start() and ob_get_clean() but they still appear in the wrong order.

// Copyright shortcode
function copyright_shortcode() {
ob_start();
echo ‘©’;
return ob_get_clean();
}

Read more here:: Shortcodes output in the wrong order

Leave a Reply

Your email address will not be published. Required fields are marked *