Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter gulliver

    (@gulliver)

    Thanks.

    But, unless I’m wrong, that doesn’t seem to enable a change to the title shown in the browser – which is configged in the core files.

    Yes you can.
    You have to follow the process, then give the page title you want !

    which is configged in the core files

    No – it’s generated by your theme’s header.php template file. Try something like:

    <?php bloginfo('name');
    if(is_search()) {
    	if( get_search_query() != '') printf( __(' - Search Results for %1$s), get_search_query()) ;
    	else {bloginfo('name'); _e(' - No search query entered!');}
    }
    elseif (is_category() || is_author()) wp_title('-',true);
    elseif(is_tag()) printf( __(' - Entries tagged with %1$s ') , wp_title('', false) );
    elseif(is_archive() ) printf( __(' - Archives for %1$s ') , wp_title('', false) );
    elseif(is_404())  _e(' - Page not found!');
    elseif (have_posts()) wp_title('-',true);
    ?>

    Between your header.php file’s <title></title> tags.

    [TYPO FIXED]

    Thread Starter gulliver

    (@gulliver)

    Thanks.

    My reason for ‘that doesn’t seem to enable a change to the title’ is because it’s using the standard header – which in the theme I’m using is <title><?php bloginfo('name'); ?> | <?php wp_title(''); ?><?php if(wp_title('', false))?></title> – and I don’t understand enough to see how the info in that article would make the required changes.

    I’m keen to learn more about this, and will be grateful for any advice.

    And my reason for ‘configged in the core files’ is that searching the WP files shows the only instance of the phrase to be in general-template.php – it doesn’t appear anywhere else nor in the theme templates.

    Esmi’s code delivered a syntax error, but I then adapted it to <title><?php bloginfo('name'); ?> | <?php if (is_404()) {_e('file not available'); } else {wp_title('');} ?></title> – which seems to work ok, but as I’m waaaaaaaaaaaaaaaaaay beyond my knowledge here hopefully someone will tell me if it creates other problems.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Rename 404 page?’ is closed to new replies.