Home > wp admin > How to display site title with post title?

How to display site title with post title?

December 1Hits:1
Advertisement

Is it possible to have the site title prepended before each post title, separated by a hyphen? For example:

[my site title] - [my post title] 

Answers

function prepend_site_name($title) {
  return get_bloginfo('name').' - '.$title;
}
add_filter('the_title','prepend_site_name');

Like that?

Related Articles

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.788 s.