php - Wordpress custom titles -
i trying add custom titles wordpress theme , having bit of trouble.
i know can use aioseo adds many functions wont use, trying make on own.
i have added few inputs in theme settings page (one home, 1 categories , on) , able store title structure in fields.
i have managed storing part, cant make proper output.
for instance, if index title store "get_bloginfo('name')", when echo it, says "get_bloginfo('name')" , not "my blog name"
how can achieve that?
btw, trying this
if ( is_page() ) { echo $pagetitle;
best regards!
you can use filter wp_title
, manipulate output. check whole function see how wordpress deals this.
here's example:
add_filter( 'wp_title', 'title_so_18414286', 10, 3 ); function title_so_18414286( $title, $sep, $seplocation ) { if ( is_category() || is_tag() ) { $title = 'title category'; } if ( is_404() ) { $title = 'page not found'; } return $title }
Comments
Post a Comment