Forums

Remove Site Title from Pages - only show custom title with SEO plugin (5 posts)

  1. Sculley
    Member
    Posted 11 months ago #

    How do I get the "site title" to not display in the title? I have added the All in One SEO plugin and am adding my meta tags that way. What's happening is the custom title is showing with the "site title" tacked on. In the header.php, I have:

    <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>

    In the header.php, is there a condition I should change this to so the "site title" won't show on Pages?

    I tried hiding the site title through the CSS but that didn't work.

  2. s_ha_dum (was apljdi)
    Member
    Posted 11 months ago #

    The name of the page is the wp_title part. The name of the blog itself is the bloginfo part. I'm not sure which you mean. Either of those have filters you could use to prevent the field from displaying on pages, or you could wrap one or both with something like this:

    <title><?php
        if (false === is_page()) {
            wp_title('«', true, 'right');
        }
        bloginfo('name'); ?>
    </title>

    Warning: Doing the later will cause a minor headache when you update the theme, unless you've created a child theme.

  3. Sculley
    Member
    Posted 11 months ago #

    Thanks apljdi. Here's the site. I'd like Site Title to show on the blog "News", however, I don't want the title to show on any of the pages. Would just like the titles in the SEO plugin field to show. Where do I find the filters?

  4. s_ha_dum (was apljdi)
    Member
    Posted 11 months ago #

    A filter is more something you write than something you find. The Codex has a pretty good explanation and some examples. You want to hook to the 'bloginfo' filter if I remember right, but no promises. I haven't tested anything.

  5. Sculley
    Member
    Posted 11 months ago #

    Thanks Apljdi!

Reply

You must log in to post.

About this Topic

Tags

No tags yet.