フォーラム

[解決済み] タイトルが空欄になる (4 件の投稿)

  1. nobita
    メンバー
    1 year前の投稿 #

    twentyten デフォルトテーマについて

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 * We filter the output of wp_title() a bit -- see
    	 * twentyten_filter_wp_title() in functions.php.
    	 */
    	wp_title( '|', true, 'right' );
    
    	?></title>

    index.phpで、トップページを表示すると、タイトルが取得できません

    個別ページでは取得できるようです

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 * We filter the output of wp_title() a bit -- see
    	 * twentyten_filter_wp_title() in functions.php.
    	 */
    	bloginfo('name').wp_title( '|', true, 'right' );
    
    	?></title>

    としてみましたが、

    私だけ、変なことになっているのでしょうか?

  2. shokun0803
    メンバー
    1 year前の投稿 #

    functions.phptwentyten_filter_wp_title()が作られてて、add_filter( 'wp_title', 'twentyten_filter_wp_title', 10, 2 );とかされてるから、ココ見たほうが早いかも;)

  3. JOTAKI Taisuke
    管理者
    1 year前の投稿 #

    コードは見てませんが、私の環境では再現しません。

    環境:
    WordPress 3.0.1
    Firefox 3.6.8
    PHP 5.3.2
    MySQL 5.1.41

    バグとは確認できないので、「使い方全般」に移します。

  4. nobita
    メンバー
    1 year前の投稿 #

    お手数をかけました

    twentyten の header.phpは、3.01で変更されたようですので、解決済みチェック入れさせていただきます。

    wordpress 3.0 rc3 twentyten header.php

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="main">
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 * We filter the output of wp_title() a bit -- see
    	 * twentyten_filter_wp_title() in functions.php.
    	 */
    	wp_title( '|', true, 'right' );
    
    	?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11" />

    wordpress 3.01 twentyten header.php

    <?php
    /**
     * The Header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="main">
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <title><?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    	global $page, $paged;
    
    	wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
    
    	?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11" />

返信

ログイン しなければ投稿できません。

About this Topic

Tags

タグ はまだありません。