How to Customize Wp Default Title and a prefix

Try this code. add_filter(‘wp_title’, ‘custom_title’); function custom_title($title) { if(is_single()) { $category = get_the_category(get_the_ID()); if(!empty($category)){ $categories = array(‘music’,’video’); if(in_array($category[0]->slug,$categories)){ return $category[0]->name.’: ‘.$title; } } } return $title; }

How do I get rid of the vertical bar in the url

This will be in your header.php, something like: <title><?php bloginfo(‘name’); ?> | <?php wp_title(); ?></title> Just change the vertical line to be included in the conditional, so that it shows on the other pages but not on the homepage, such as: <title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?>| <?php } ?> <?php … Read more

Set title of page using custom page template

For dog breeds, I added the following code to template pages, overwriting the WP SEO functions: function assignPageTitle() { // To set page title global $resultarray; return $resultarray->breed_title; } if ( uri_segment( 2 ) != ‘0’ ) { add_filter( ‘wpseo_title’, ‘assignPageTitle’ ); // WP SEO function overwritten } For a list of other WP SEO … Read more

The tags can only contain a call to wp_title(). Use the wp_title filter to modify the output

add_theme_support( ‘title-tag’ ) doesn’t belong in your header template. It belongs in your functions.php file. Usually, it’s best to wrap it in it’s own function and hook it to after_setup_theme in order to allow plugins and child themes to override it later if they need to. So… function wpse_add_title_support() { add_theme_support( ‘title-tag’ ); } add_action … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)