SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Wordpress title issue

    Hello,

    I am facing issue in the page title of wordpress post.

    Example link : http://www.apniisp.com/blog/krrish-3...ess-conference

    Current page title : Krrish 3 Dubai press conferenceApniISP.Com - Blog

    In the above title, first part is the post title and second part is blog name but both are coming together.

    How can I put a space between them?

    Best Regards
    Hassan

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,832
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    In one of your template files there should be a <title></title> HTML element that has the Wordpress function inside of it which generates the title of the document. I don't know how your template hierarchy is set up, but the first place for you too look is in your template's header.php file if there is one and look for something like this:

    Code:
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    The first argument in the wp_title function call is the separator between the post title and the name of your website. Mine is a pipe character (|). Between the two single quotes you can put in one or more spaces that will place spaces between your post title and site name. Something like this:


    Code:
    <title><?php wp_title( ' ', true, 'right' ); ?></title>
    The PHP code between your <title></title> elements may be different. The idea is the same. Another example:

    <title><?php bloginfo('name'); ?><?php wp_title(' '); ?></title>

    http://codex.wordpress.org/Function_Reference/wp_title

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi cheesedude,

    I found this in the header.php under my current theme folder and tried to place spaces according to your instructions but nothing changes.

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

    Best Regards
    Hassan

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,832
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Inside of your <title> element put the word "TEST" like this and remove it when testing is done:

    Code:
    <title>TEST <?php wp_title( '|', true, 'right' ); ?></title>
    Make sure you save the file. And it would be a good idea to make a backup copy of your files before you modify them.

    If changing header.php does not work, you are going to have to explore a few more of your template files to determine where in the Wordpress template hierarchy your <title> text is coming from. Try looking in index.php, category.php, and then work your way through the rest of the files. It has to be in there somewhere. Now that you know what you are looking for, you are going to have to search through your template files and find it.

    http://codex.wordpress.org/Theme_Development

    One thing that always bothered me about Wordpress is that HTML can come from different places. It's like looking for a needle in a haystack sometimes.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •