This snippet displays the name of the current WordPress website using a simple shortcode. It is useful for reusable headers, footers, and custom content.
<?php
function display_website_name() {
return '<span class="website-name">' .
esc_html( get_bloginfo( 'name' ) ) .
'</span>';
}
add_shortcode( 'website_name', 'display_website_name' );