WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] More leeway over the page's title (5 posts)

  1. dansbanners
    Member
    Posted 1 year ago #

    Hi,

    I just want my main page to say something along the lines of "Welcome to Dansbanners!".

    And then on each page just state the title of the post or page such as "Importance of Using Trackers!" or "Paid To Clicks".

    Rather than the way it currently is, including the "| Dansbanners" on each page's title as in the following:

    "Importance of Using Trackers! | Dansbanners"

    or

    "Paid To Clicks | Dansbanners"
    .
    .
    etc

    I know it has something to do with the following code:

    <title><?php bloginfo('name'); ?><?php wp_title('»',true,'left'); ?></title>

    I did try to experiment with the above code a bit but ran into errors.

    Anyone have any suggestions on how to solve this dilemma?

    I'd appreciate it. Thanks in advance!

  2. vtxyzzy
    Member
    Posted 1 year ago #

    There can be several things that cause this. One of the most common is an SEO plugin that adds to the title. If you are using an SEO plugin, check its options to see if it is causing the problem.

    If not, it is probably a part of your theme. Try switching themes to see if you still have the problem.

  3. dansbanners
    Member
    Posted 1 year ago #

    I deactivated the SEO plugin and it did solve parts of the problem.

    Now, which brings a different dilemma. The following title code:

    <title><?php bloginfo('name'); ?><?php wp_title('»',true,'left'); ?></title>

    Such that on the main page, the title will be "Dansbanners"

    And on the rest of each page, it'll show the following

    "Dansbanners » Whatever is Page Title on that page"

    I'm wondering how can I get it to work such that it'll only show "Dansbanners" on the main page. And then on the rest of each page, it'll only show the page title without the "Dansbanners »".

    I know one possibility is to have the title code just to the following:

    <title><?php wp_title('',true,'left'); ?></title>

    It'll take away the "Dansbanners »" from each page. But then there'll be no title on the main page.

    Anyone have any suggestion on how to solve this dilemma?

    I'd appreciate it. Thanks in advance!

  4. vtxyzzy
    Member
    Posted 1 year ago #

    Try using a conditional around the 'Dansbanners':

    <title><?php if ( is_home() ) bloginfo('name'); ?><?php wp_title('»',true,'left'); ?></title>

    If you are using a static front page, use is_front_page() instead.

  5. dansbanners
    Member
    Posted 1 year ago #

    That did the trick. Thanks! : )

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.