WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] why meta:title need `` at the end?? (6 posts)

  1. youlichika
    Member
    Posted 2 years ago #

    reference the page:Meta Tags in WordPress

    I set meta:title in my page. but why meta:title need </title /> at the end?

    I have tried
    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title> nothing print out in html source.

    but <title><?php bloginfo('name'); ?><?php wp_title(); ?></title /> could get the title part.

    And in wordpress.org, the meta:title is <title>WordPress › Blog Tool, Publishing Platform, and CMS</title> not <title>WordPress › Blog Tool, Publishing Platform, and CMS</title />

    What is this problem?

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    this was an error in the Codex; and is now corrected.

    http://www.w3schools.com/tags/tag_title.asp

  3. youlichika
    Member
    Posted 2 years ago #

    @alchymyth, hey, I know this is an error, but when I use </title> the W3C standard, I can not out put the title in the page html source code.

    And only use the uncorrected tag </title />, it become effective. Where is the problem? Is it setting in filter.php or function,php I can not find the problem.

  4. alchymyth
    Forum Moderator
    Posted 2 years ago #

    can you post a link to your site, and state if you have used </title /> or </title> ?

  5. youlichika
    Member
    Posted 2 years ago #

    @alchymyth, I can post a link to my site, but I can not add title, even some simple word <title>example</title>, if I add some thing like </title>, the meta:title will disappear in page html source code.

    BTW: in theme function.php, I remove something

    define( 'BP_SILENCE_THEME_NOTICE', true );
    remove_action('wp_head','rsd_link');
    remove_action('wp_head','feed_links_extra',3);
    remove_action('wp_head','feed_links',2);
    remove_action('wp_head','wlwmanifest_link');
    remove_action('wp_head','index_rel_link');
    remove_action('wp_head','wp_generator');
    remove_action('wp_head','adjacent_posts_rel_link_wp_head', 10, 0 );
    remove_action('wp_head','wp_generator');
    remove_action('wp_head','parent_post_rel_link');
    remove_action('wp_head','start_post_rel_link');
    remove_action('wp_head','adjacent_posts_rel_link');
  6. youlichika
    Member
    Posted 2 years ago #

    devil, solve it.

    in wp-includes/formatting.php, find the line

    // Remove metadata tags
    $content = preg_replace('/<title>(.+?)<\/title>/','',$content);

    remove this line, then the title is back to my page html source code. Waste a few hours, for this fool behave.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags