I had been focusing on a header that may be used globally for my website. Regrettably, this includes lots of conditional checking for WordPress functions, to ensure that I finish track of the right data for titles. I've got a bit of code that inspections to ascertain if the function that delivers a title for WordPress pages is available. Whether it does, after that it inspections to ascertain if that function returns anything. Whether it does not, it prints a default title. Otherwise, it prints the title and appends a typical title into it. My problem is it appears to print the title, after which appends the default title. So rather than printing: "pageTitle-append" it prints "pageTitleStandardTitle-append". Here's my code:

if(function_exists('wp_title')):
    if(wp_title()):
        wp_title();
        echo ' - Standard Appended Title';
    else:
        echo 'Blog - Standard Appended Title';
    endif;
else:
    echo $title.' - Standard Appended Title';
endif;

This will get it done :

if(function_exists('wp_title')) {

    $wp_title = wp_title(false,false,false);

    if($wp_title) {

        echo $wp_title;

    } else {

        echo 'Blog';
    }

} else {

    echo $title;

}

echo ' - Standard Appended Title';