I want to display the Title of my Wordpress Site on the single blog posts pages.
I use the following line of code in my theme's 'single blog post.php'
<h1><?php $site_title = get_bloginfo( 'name' ); ?></h1>
However it does not show anything.
For only a list of post titles, you could swap your current front page with a static front page and either use the Archives shortcode or the Display Posts shortcode.
You are not outputting anything to show. You are only assigning blog name to a variable. You need to echo the content. It should be :
<h1><?php echo get_bloginfo( 'name' ); ?></h1>
Hope this helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With