当サイト、Codex 日本語版は今後積極的な更新は行わない予定です。後継となる新ユーザーマニュアルは、https://ja.wordpress.org/support/ にあります。
万が一、当サイトで重大な問題を発見した際などは、フォーラムWordSlack #docs チャンネルでお知らせください。</p>

「FAQ/レイアウトとデザイン」の版間の差分

提供: WordPress Codex 日本語版
< FAQ
移動先: 案内検索
(en:FAQ Layout and Design 14:42, April 4, 2008 Stevish 版を翻訳用にコピー)
 
(I am having trouble with my CSS so where can I find help?)
 
(6人の利用者による、間の17版が非表示)
1行目: 1行目:
[[FAQ|Back to FAQ]]
+
{{NeedTrans}}
 
__TOC__
 
__TOC__
  
== Layout and Styles ==
+
<div id="Layout_and_Styles">
 +
== レイアウトとスタイル ==
 +
</div>
  
===I am having trouble with my CSS so where can I find help?===
+
===CSSでトラブルがあったときはどこを見ればいいですか?===
 +
<!-- 原題: I am having trouble with my CSS so where can I find help? -->
 
The following are articles that will help you troubleshoot and solve many of your CSS problems:
 
The following are articles that will help you troubleshoot and solve many of your CSS problems:
  
 
* [[Blog Design and Layout]]
 
* [[Blog Design and Layout]]
* [[Finding Your CSS Styles]]
+
* [[Finding Your CSS Styles]] /[[:en:Finding Your CSS Styles|en]]
* [[CSS Fixing Browser Bugs]]
+
* [[CSS Fixing Browser Bugs]] /[[:en:CSS Fixing Browser Bugs|en]]
* [[CSS Troubleshooting]]
+
* [[CSS Troubleshooting]] /[[:en:CSS Troubleshooting|en]]
* [[CSS|WordPress CSS Information and Resources]]
+
* [[CSS|WordPress CSS Information and Resources]] /[[:en:CSS|en]]
  
 
===How can I choose different styles or colours for my comments?===
 
===How can I choose different styles or colours for my comments?===
 +
<!-- 原題: How can I choose different styles or colours for my comments? -->
 
There are a variety of WordPress Plugins that change the look, layout, and colors of your comments and comment form. Look for various Comments Plugins in the [http://wordpress.org/extend/plugins/ Official WordPress Plugin Directory].
 
There are a variety of WordPress Plugins that change the look, layout, and colors of your comments and comment form. Look for various Comments Plugins in the [http://wordpress.org/extend/plugins/ Official WordPress Plugin Directory].
 +
 +
===ポップアップコメントのウインドウの大きさはどのように変えるのですか?===
 +
<!-- 原題: How do I change the size of the popup comments window? -->
 +
WordPress バージョン1.5におけるポップアップ・コメント・ウインドウのサイズ調整は comment-functions.php ファイルを変更します。同ファイルの function comments_popup_script($width=400, $height=400, $file=) {. をご参照下さい。
 +
 +
WordPress バージョン1.2.1 Mingus におけるポップアップ・コメント・ウインドウのサイズ調整は template-functions-comment.php の50行目を変更して下さい。
 +
 +
<pre><nowiki>function comments_popup_script($width=400, $height=400,
 +
$file='wp-comments-popup.php')</nowiki></pre>
 +
 +
wp-comments-popup.php の81行目を変更することで、textarea のサイズ変更も可能です。
 +
 +
===Where can I find some other Themes and templates to use for styling my blog?===
 +
<!-- 原題: Where can I find some other Themes and templates to use for styling my blog? -->
 +
 +
See [[テーマの使い方]]
 +
<!-- ドキュメントのメンテが大変になるので「テーマの使い方」に集約し、以下コメントアウト。
 +
* [http://themes.wordpress.net/theme-viewer.php WordPress Theme Viewer]
 +
* [http://www.bloggingpro.com/ Blogging Pro features a whole category of WordPress Themes]
 +
* [http://codex.wordpress.org/Using_Themes/Theme_List The "official" WordPress Theme List]
 +
* [http://www.alexking.org/blog/2005/02/27/wordpress-theme-competition/ Alex King's WordPress Theme Competition]
 +
-->
 +
 +
===Where can I find information about styling lists and nested lists?===
 +
<!-- 原題: Where can I find information about styling lists and nested lists? -->
 +
See [[Styling Lists with CSS]]/[[:en:Styling Lists with CSS|en]]
 +
 +
===How do I change the way menu links are listed?===
 +
<!-- 原題: How do I change the way menu links are listed? -->
 +
See [[Styling Lists with CSS]]/[[:en:Styling Lists with CSS|en]]
 +
 +
===How do I get rid of the bullet points next to my links?===
 +
<!-- 原題: How do I get rid of the bullet points next to my links? -->
 +
See [[Styling Lists with CSS]]/[[:en:Styling Lists with CSS|en]]
 +
 +
===How can I create horizontal menus?===
 +
<!-- 原題: How can I create horizontal menus? -->
 +
See [[Creating Horizontal Menus]]/[[:en:Creating Horizontal Menus|en]]
 +
 +
===How can I get my categories to display in the order I want?===
 +
<!-- 原題: How can I get my categories to display in the order I want? -->
 +
Two tags are involved in generating your category list.  For more information on setting the order and look of these see [[テンプレートタグ/wp_list_categories|wp_list_categories()]]<!-- 非推奨タグをコメントアウト: [[Template Tags/list cats|list_cats()]] and [[Template Tags/wp_list_cats|wp_list_cats()]]-->.
 +
 +
===How can I get my links to open in a new window?===
 +
<!-- 原題: How can I get my links to open in a new window? -->
 +
Opening links in a new window is considered bad form in today's web as it has been abused. Yet, it still serves a purpose for demonstration sites that require more than one window open at a time.  This method will work for those links that you enter into the body of a post.
 +
 +
After entering the link using the Quicktags button for "link", add <tt>target="_blank"</tt> to the individual*- link you want to have open in a new window when clicked. Consider adding text indicating that this link will open a new window, as required by web accessibility standards.
 +
 +
<pre>
 +
<a href="<nowiki>http://example.com/page.php</nowiki>"
 +
title="Page Title - opens in new window" target="_blank">
 +
Page Title (Opens in new window)</a>
 +
</pre>
 +
 +
===Is there a tool to encode ''HTML'' entities and tags so I can display code on my weblog?===
 +
<!-- 原題: Is there a tool to encode ''HTML'' entities and tags so I can display code on my weblog? -->
 +
The article [[Writing Code in Your Posts]]/[[:en:Writing Code in Your Posts|en]] will help you write programming code and code examples in your posts. The [http://wordpress.org/resources/tools/encode.php Encode tool] will convert your [[用語集#HTML|HTML]]/[[用語集#XHTML|XHTML]] code into a form that can be displayed on your [[用語集#Blog|blog]] without it being treated as [[用語集#HTML|HTML]] by browsers.
 +
 +
There are also WordPress [[プラグイン|Plugins]] and other tools available to help integrate this proces into your site if you use it frequently to display code.
 +
 +
* [http://scott.yang.id.au/2004/05/syntax-hilight-enscript/ Scott Yang's Syntax Highlighting with Enscript in WordPress]
 +
* [http://redalt.com/downloads/ Owen Winkler's Code Filter]
 +
 +
Also see: [[Fun Character Entities]]/[[:en:Fun Character Entities|en]]
 +
 +
===How do I do a ''dropcaps'' on the first letter of a post?===
 +
<!-- 原題: How do I do a ''dropcaps'' on the first letter of a post? -->
 +
''DropCaps'' is the name for the effect where the first letter of the first paragraph in an article drops below the line of text, and is displayed in a larger font-size than the other normal letters.
 +
 +
This can be done using BBCode quicktags. First, add this to your ''style sheet'':
 +
<pre>
 +
#fp:first-letter {
 +
font-size : 300%;
 +
font-weight : bold;
 +
float : left;
 +
margin-right: 3px;
 +
}
 +
</pre>
 +
then add following code to file ''/wp-includes/js/quicktags.js'' and put them among ''edButtons'':
 +
<pre>
 +
edButtons[edButtons.length] =
 +
new edButton('ed_capdrop'
 +
,'CapDrop'
 +
,'<p id="fp">'
 +
,'</p>'
 +
,'c'
 +
);
 +
</pre>
 +
 +
You will now see a CapDrop quicktag in your edit window.
 +
 +
See also:
 +
* [http://wordpress.org/support/topic/9542 drop caps support question]
 +
 +
===Where should I look for more information on CSS?===
 +
<!-- 原題: Where should I look for more information on CSS? -->
 +
See [[CSS]]/[[:en:CSS|en]]
 +
 +
<div id="Text and Content Display">
 +
 +
== どうやって自分のコメントに異なるスタイルや色を付けたらいいの? ==
 +
 +
WorldPress にはコメントやフォームの見た目、レイアウト、色を変更する様々なプラグインがあります。次のページからプラグインを探せばいいよ。[http://wordpress.org/extend/plugins/ Official WordPress Plugin Directory]
  
 
===How do I change the size of the popup comments window?===
 
===How do I change the size of the popup comments window?===
 +
<!-- 原題: How do I change the size of the popup comments window? -->
 
To change the look of the Popup Comments window in WordPress version 1.5, make changes to the <tt>comment-functions.php</tt> file where it shows the following line: <tt>function comments_popup_script($width=400, $height=400, $file='') {</tt>.
 
To change the look of the Popup Comments window in WordPress version 1.5, make changes to the <tt>comment-functions.php</tt> file where it shows the following line: <tt>function comments_popup_script($width=400, $height=400, $file='') {</tt>.
  
27行目: 136行目:
  
 
===Where can I find some other Themes and templates to use for styling my blog?===
 
===Where can I find some other Themes and templates to use for styling my blog?===
 +
<!-- 原題: Where can I find some other Themes and templates to use for styling my blog? -->
 +
 +
See [[テーマの使い方]]
 +
<!-- ドキュメントのメンテが大変になるので「テーマの使い方」に集約し、以下コメントアウト。
 
* [http://themes.wordpress.net/theme-viewer.php WordPress Theme Viewer]
 
* [http://themes.wordpress.net/theme-viewer.php WordPress Theme Viewer]
 
* [http://www.bloggingpro.com/ Blogging Pro features a whole category of WordPress Themes]
 
* [http://www.bloggingpro.com/ Blogging Pro features a whole category of WordPress Themes]
 
* [http://codex.wordpress.org/Using_Themes/Theme_List The "official" WordPress Theme List]
 
* [http://codex.wordpress.org/Using_Themes/Theme_List The "official" WordPress Theme List]
 
* [http://www.alexking.org/blog/2005/02/27/wordpress-theme-competition/ Alex King's WordPress Theme Competition]
 
* [http://www.alexking.org/blog/2005/02/27/wordpress-theme-competition/ Alex King's WordPress Theme Competition]
 +
-->
  
 
===Where can I find information about styling lists and nested lists?===
 
===Where can I find information about styling lists and nested lists?===
See [[Styling Lists with CSS]]
+
<!-- 原題: Where can I find information about styling lists and nested lists? -->どこででスタイルシートやネストしたリストについての情報を得ることができますか?
 +
See [[Styling Lists with CSS]]/[[:en:Styling Lists with CSS|en]]
  
 
===How do I change the way menu links are listed?===
 
===How do I change the way menu links are listed?===
See [[Styling Lists with CSS]]
+
<!-- 原題: How do I change the way menu links are listed? -->
 +
See [[Styling Lists with CSS]]/[[:en:Styling Lists with CSS|en]]
  
 
===How do I get rid of the bullet points next to my links?===
 
===How do I get rid of the bullet points next to my links?===
See [[Styling Lists with CSS]]
+
<!-- 原題: How do I get rid of the bullet points next to my links? -->
 +
See [[Styling Lists with CSS]]/[[:en:Styling Lists with CSS|en]]
  
 
===How can I create horizontal menus?===
 
===How can I create horizontal menus?===
See [[Creating Horizontal Menus]]
+
<!-- 原題: How can I create horizontal menus? -->
 +
See [[Creating Horizontal Menus]]/[[:en:Creating Horizontal Menus|en]]
  
 
===How can I get my categories to display in the order I want?===
 
===How can I get my categories to display in the order I want?===
Two tags are involved in generating your category list.  For more information on setting the order and look of these see [[Template Tags/list cats|list_cats()]] and [[Template Tags/wp_list_cats|wp_list_cats()]].
+
<!-- 原題: How can I get my categories to display in the order I want? -->
 +
Two tags are involved in generating your category list.  For more information on setting the order and look of these see [[テンプレートタグ/wp_list_categories|wp_list_categories()]]<!-- 非推奨タグをコメントアウト: [[Template Tags/list cats|list_cats()]] and [[Template Tags/wp_list_cats|wp_list_cats()]]-->.
  
 
===How can I get my links to open in a new window?===
 
===How can I get my links to open in a new window?===
 +
<!-- 原題: How can I get my links to open in a new window? -->
 
Opening links in a new window is considered bad form in today's web as it has been abused. Yet, it still serves a purpose for demonstration sites that require more than one window open at a time.  This method will work for those links that you enter into the body of a post.
 
Opening links in a new window is considered bad form in today's web as it has been abused. Yet, it still serves a purpose for demonstration sites that require more than one window open at a time.  This method will work for those links that you enter into the body of a post.
  
59行目: 179行目:
  
 
===Is there a tool to encode ''HTML'' entities and tags so I can display code on my weblog?===
 
===Is there a tool to encode ''HTML'' entities and tags so I can display code on my weblog?===
The article [[Writing Code in Your Posts]] will help you write programming code and code examples in your posts. The [http://wordpress.org/resources/tools/encode.php Encode tool] will convert your [[Glossary#HTML|HTML]]/[[Glossary#XHTML|XHTML]] code into a form that can be displayed on your [[Glossary#Blog|blog]] without it being treated as [[Glossary#HTML|HTML]] by browsers.
+
<!-- 原題: Is there a tool to encode ''HTML'' entities and tags so I can display code on my weblog? -->
 +
The article [[Writing Code in Your Posts]]/[[:en:Writing Code in Your Posts|en]] will help you write programming code and code examples in your posts. The [http://wordpress.org/resources/tools/encode.php Encode tool] will convert your [[用語集#HTML|HTML]]/[[用語集#XHTML|XHTML]] code into a form that can be displayed on your [[用語集#Blog|blog]] without it being treated as [[用語集#HTML|HTML]] by browsers.
  
There are also WordPress [[Plugins]] and other tools available to help integrate this proces into your site if you use it frequently to display code.
+
There are also WordPress [[プラグイン|Plugins]] and other tools available to help integrate this proces into your site if you use it frequently to display code.
  
 
* [http://scott.yang.id.au/2004/05/syntax-hilight-enscript/ Scott Yang's Syntax Highlighting with Enscript in WordPress]
 
* [http://scott.yang.id.au/2004/05/syntax-hilight-enscript/ Scott Yang's Syntax Highlighting with Enscript in WordPress]
 
* [http://redalt.com/downloads/ Owen Winkler's Code Filter]
 
* [http://redalt.com/downloads/ Owen Winkler's Code Filter]
  
Also see: [[Fun Character Entities]]
+
Also see: [[Fun Character Entities]]/[[:en:Fun Character Entities|en]]
  
 
===How do I do a ''dropcaps'' on the first letter of a post?===
 
===How do I do a ''dropcaps'' on the first letter of a post?===
 +
<!-- 原題: How do I do a ''dropcaps'' on the first letter of a post? -->
 
''DropCaps'' is the name for the effect where the first letter of the first paragraph in an article drops below the line of text, and is displayed in a larger font-size than the other normal letters.
 
''DropCaps'' is the name for the effect where the first letter of the first paragraph in an article drops below the line of text, and is displayed in a larger font-size than the other normal letters.
  
96行目: 218行目:
 
* [http://wordpress.org/support/topic/9542 drop caps support question]
 
* [http://wordpress.org/support/topic/9542 drop caps support question]
  
===Where should I look for more information on CSS?===
+
===CSS についてもっと詳しく調べたい時はどこを参照すればいいでしょうか?===
See [[CSS]]
+
<!-- 原題: Where should I look for more information on CSS? -->
 +
See [[CSS]]/[[:en:CSS|en]]
 +
 
 +
<div id="Text and Content Display">
  
== Text and Content Display ==
+
== テキストとコンテンツ表示 ==
 +
</div>
  
===How do I show only the titles of articles on the weblog homepage?===
+
===ウェブログのホームページで記事のタイトルのみ表示する===
To show only the title of posts on the weblog homepage, in ''index.php'' replace
+
<!-- 原題: How do I show only the titles of articles on the weblog homepage? -->
 +
ェブログのホームページに投稿のタイトルのみを表示するには, ''index.php'' の中を置き換えます
 
  <?php the_content(); ?>
 
  <?php the_content(); ?>
 
With something like:
 
With something like:
113行目: 240行目:
 
  ?>
 
  ?>
  
This will show the post content only on the individual posts page.
+
これは個人の投稿ページのみに投稿内容が表示されます。
  
===How do I use the blogroll links rating feature to display the ratings?===
+
===ブログロールのリンク評価機能を使用して評価を表示する方法===
In WordPress 1.5 and later, you have the option to rate the links in your Link Manager (Blogroll) and display the ratings for the world to see.
+
<!-- 原題: How do I use the blogroll links rating feature to display the ratings? -->
 +
WordPress1.5以降にはリンクマネージャー(ブログロール)で評価を参照表示するオプションがあります。
  
 
To rate your links, edit the particular link (by using the "Links" editing interface, or "Blogroll" in later versions of WordPress -- rating is in the Advanced section), and rate the link from 0 - 10 using the dropdown menu.
 
To rate your links, edit the particular link (by using the "Links" editing interface, or "Blogroll" in later versions of WordPress -- rating is in the Advanced section), and rate the link from 0 - 10 using the dropdown menu.
  
To get your link ratings to display, you may need to edit your Theme. See the documentation for the [[Template_Tags/wp_list_bookmarks|wp_list_bookmarks()]] or [[Template_Tags/get_links|get_links()]] Template Tags for more information.
+
To get your link ratings to display, you may need to edit your Theme. See the documentation for the [[テンプレートタグ/wp_list_bookmarks|wp_list_bookmarks()]] or [[テンプレートタグ/get_links|get_links()]] Template Tags for more information.
  
 
In WordPress 1.2, the procedure is slightly different. First, for each link category, you have to turn on the display of link ratings (Links -> Link Categories -> Show -> Rating).
 
In WordPress 1.2, the procedure is slightly different. First, for each link category, you have to turn on the display of link ratings (Links -> Link Categories -> Show -> Rating).
127行目: 255行目:
 
* a character (* by default)
 
* a character (* by default)
 
* a number (the rating, 0-9)
 
* a number (the rating, 0-9)
* images -- if you are using Images, you have the choice of using the same image displayed n times to show a rating of n, or using 10 different images, for one through 10.  
+
* images -- if you are using Images, you have the choice of using the same image displayed n times to show a rating of n, or using 10 different images, for one through 10.
  
 
===How do I show an excerpt or teaser for an article on the weblog homepage?===
 
===How do I show an excerpt or teaser for an article on the weblog homepage?===
An ''excerpt'' should not be confused with the ''teaser'' which refers to the first few sentences or paragraphs of a [[Glossary#Post|post]].  When typing a long post you can insert the <nowiki><!--more--></nowiki> [[Write_Post_SubPanel#Quicktags|Quicktag]] after a few sentences to act as a cut-off point.  When the post is displayed on a category page, archive page, or home page, the '''teaser''' is displayed, followed by a hyperlink (such as '''Read the rest of this entry...''').  Your visitor can then click on that link to see the full version of your [[Glossary#Post|post]].   
+
<!-- 原題: How do I show an excerpt or teaser for an article on the weblog homepage? -->
 +
An ''excerpt'' should not be confused with the ''teaser'' which refers to the first few sentences or paragraphs of a [[用語集#Post|post]].  When typing a long post you can insert the <nowiki><!--more--></nowiki> [[Write Post SubPanel#Quicktags|Quicktag]]/[[:en:Write Post SubPanel#Quicktags|en]] after a few sentences to act as a cut-off point.  When the post is displayed on a category page, archive page, or home page, the '''teaser''' is displayed, followed by a hyperlink (such as '''Read the rest of this entry...''').  Your visitor can then click on that link to see the full version of your [[用語集#Post|post]].   
  
Note that some [[Using Themes|Themes]] do not support the '''more''' ability.  More information on how to present the '''more''' information can be found at [[Template Tags|Template Tag]] [[Template_Tags/the_content|the_content()]] and [[Customizing the Read More]].
+
Note that some [[テーマの使い方|Themes]] do not support the '''more''' ability.  More information on how to present the '''more''' information can be found at [[テンプレートタグ|Template Tag]] [[テンプレートタグ/the_content|the_content()]] and [[Customizing the Read More]]/[[:en:Customizing the Read More|en]].
  
As stated before, recognize that use of the '''more''' feature should not be confused with the [[Glossary#Excerpt|Excerpt]] field in your [[Administration Panels|Administration]] > [[Administration_Panels#Write_-_Make_some_content|Write]] > [[Write_Post_SubPanel#Advanced_Post_Editing|Write Post Panel]].  The [[Template Tags|Template Tag]] [[Template Tags/the excerpt|the_excerpt()]] can be used to access the contents of this field (i.e. the excerpt you enter in your blog will not be used for anything unless you have <tt>the_excerpt</tt> in your theme, or you choose to include excerpts only in your RSS fields).
+
As stated before, recognize that use of the '''more''' feature should not be confused with the [[用語集#Excerpt|Excerpt]] field in your [[管理パネル|Administration]] > [[管理パネル#Write - Make some content|Write]] > [[Write Post SubPanel#Advanced Post Editing|Write Post Panel]]/[[:en:Write Post SubPanel#Advanced Post Editing|en]].  The [[テンプレートタグ|Template Tag]] [[テンプレートタグ/the_excerpt|the_excerpt()]] can be used to access the contents of this field (i.e. the excerpt you enter in your blog will not be used for anything unless you have <code>the_excerpt</code> in your theme, or you choose to include excerpts only in your RSS fields).
  
 
===How do I customise the text shown in "(more.....)" on my weblog?===
 
===How do I customise the text shown in "(more.....)" on my weblog?===
See [[Customizing the Read More]]
+
<!-- 原題: How do I customise the text shown in "(more.....)" on my weblog? -->
 +
See [[Customizing the Read More]]/[[:en:Customizing the Read More|en]]
  
 
==Images and Graphics==
 
==Images and Graphics==
  
 
===How to add a favicon to your site===
 
===How to add a favicon to your site===
 +
<!-- 原題: How to add a favicon to your site -->
 
To add a favicon to your site in WordPress 2.0, place your '''favicon.ico''' file inside your theme folder (for example: ''wp-content/themes/default/'') then add this line to ''header.php'':
 
To add a favicon to your site in WordPress 2.0, place your '''favicon.ico''' file inside your theme folder (for example: ''wp-content/themes/default/'') then add this line to ''header.php'':
  
148行目: 279行目:
 
Be sure to add it somewhere within the <nowiki><head></head></nowiki> section.
 
Be sure to add it somewhere within the <nowiki><head></head></nowiki> section.
  
See [[favicon.ico|Creating and Installing a Favicon]] For more detailed instructions.
+
See [[favicon.ico|Creating and Installing a Favicon]]/[[:en:favicon.ico|en]] For more detailed instructions.
  
 
===Where can I get some buttons for my site?===
 
===Where can I get some buttons for my site?===
 +
<!-- 原題: Where can I get some buttons for my site? -->
  
 
Buttons are like badges you display on your website to show your affection for something, or to display information regarding your cultural, social, political or technical leanings.   
 
Buttons are like badges you display on your website to show your affection for something, or to display information regarding your cultural, social, political or technical leanings.   
156行目: 288行目:
 
To add a WordPress button to your site showing support for the WordPress Community:
 
To add a WordPress button to your site showing support for the WordPress Community:
  
*[[Contributing_to_WordPress#Show_You_Care|Contributing to WordPress, Show you Care]]
+
*[[Contributing to WordPress#Show You Care|Contributing to WordPress, Show you Care]]/[[:en:Contributing to WordPress#Show You Care|en]]
  
 
For more buttons, see:
 
For more buttons, see:
164行目: 296行目:
  
 
===How do I get WordPress to generate links to the thumbnail of an uploaded picture?===
 
===How do I get WordPress to generate links to the thumbnail of an uploaded picture?===
 +
<!-- 原題: How do I get WordPress to generate links to the thumbnail of an uploaded picture? -->
 
WordPress by default only produces very limited code after uploading a picture. If you want to get code for the thumbnail link, the thumbnail etc, autogenerated, the following resources will be useful, including a possible hack that may not work for WordPress v1.5 at [http://wordpress.org/support/topic/5325 Thumbnail HTML addition for upload.php].
 
WordPress by default only produces very limited code after uploading a picture. If you want to get code for the thumbnail link, the thumbnail etc, autogenerated, the following resources will be useful, including a possible hack that may not work for WordPress v1.5 at [http://wordpress.org/support/topic/5325 Thumbnail HTML addition for upload.php].
  
 
See also:
 
See also:
*[[Using Images]]
+
*[[Using Images]]/[[:en:Using Images|en]]
*[[Photoblogs and Galleries]]
+
*[[Photoblogs and Galleries]]/[[:en:Photoblogs and Galleries|en]]
  
 
===How can I use a custom image for my list bullets?===
 
===How can I use a custom image for my list bullets?===
 +
<!-- 原題: How can I use a custom image for my list bullets?-->
 
See also:
 
See also:
*[[Styling Lists with CSS]]
+
*[[Styling Lists with CSS]]/[[:en:Styling Lists with CSS|en]]
*[[Customizing Your Sidebar]]
+
*[[Customizing Your Sidebar]]/[[:en:Customizing Your Sidebar|en]]
  
 
===How do I rotate/cycle/randomize the image in the header of the weblog?===
 
===How do I rotate/cycle/randomize the image in the header of the weblog?===
 +
<!-- 原題: How do I rotate/cycle/randomize the image in the header of the weblog? -->
 
See also:
 
See also:
*[[Designing_Headers#Rotating_Header_Images|Designing Headers, Rotating Header Images]]
+
*[[Designing Headers#Rotating Header Images|Designing Headers, Rotating Header Images]]/[[:en:Designing Headers#Rotating Header Images|en]]
  
 
===How do I link to my own images?===
 
===How do I link to my own images?===
You can use absolute or relative [[Glossary#URI and URL|URI/URLs]] addresses.
+
<!-- 原題: How do I link to my own images? -->
 +
You can use absolute or relative [[用語集#URI and URL|URI/URLs]] addresses.
  
 
To use a relative link, set the address from the '''root''' folder of your site by using a slash in front of the folder in the root directory.
 
To use a relative link, set the address from the '''root''' folder of your site by using a slash in front of the folder in the root directory.
190行目: 326行目:
  
 
===How can I display images in my category and archive pages?===
 
===How can I display images in my category and archive pages?===
When using the default [[Glossary#Theme|theme]], you'll notice images (and links) do not appear when visiting category and archive query pages. This has to do with how the default theme displays post content in those sections of your blog. To change this behavior,  edit the default theme's Archive Template (archive.php). You can do this online through the [[Administration_Panels#Theme_Editor|Theme Editor]], or offline by downloading and opening the default theme's archive.php in any text editor. Once in the Archive Template, look for this section:
+
<!-- 原題: How can I display images in my category and archive pages? -->
 +
When using the default [[用語集#Theme|theme]], you'll notice images (and links) do not appear when visiting category and archive query pages. This has to do with how the default theme displays post content in those sections of your blog. To change this behavior,  edit the default theme's Archive Template (archive.php). You can do this online through the [[管理パネル#Theme Editor|Theme Editor]], or offline by downloading and opening the default theme's archive.php in any text editor. Once in the Archive Template, look for this section:
  
 
  &lt;div class="entry"&gt;
 
  &lt;div class="entry"&gt;
196行目: 333行目:
 
  &lt;/div&gt;
 
  &lt;/div&gt;
  
Here, change [[Template_Tags/the_excerpt|the_excerpt()]] template tag, which displays a summary of a post's content while filtering out all [[Glossary#HTML|HTML]] tags. To display each post's whole content (and HTML tags), use [[Template_Tags/the_content|the_content()]] template tag:
+
Here, change [[テンプレートタグ/the_excerpt|the_excerpt()]] template tag, which displays a summary of a post's content while filtering out all [[用語集#HTML|HTML]] tags. To display each post's whole content (and HTML tags), use [[テンプレートタグ/the_content|the_content()]] template tag:
  
&lt;div class="entry"&gt;
+
<pre>
 +
<div class="entry">
 
     <?php the_content(); ?>
 
     <?php the_content(); ?>
&lt;/div&gt;
+
</div>
 +
</pre>
  
 
===Where can I find more information on images, PhotoBlogs, and photo galleries?===
 
===Where can I find more information on images, PhotoBlogs, and photo galleries?===
 +
<!-- 原題: Where can I find more information on images, PhotoBlogs, and photo galleries? -->
 
See also:
 
See also:
*[[Using Images]]
+
*[[Using Images]]/[[:en:Using Images|en]]
*[[Photoblogs and Galleries]]
+
*[[Photoblogs and Galleries]]/[[:en:Photoblogs and Galleries|en]]
  
==Template Tags==
+
<div id="Template Tags">
 +
== テンプレートタグ ==
 +
</div>
  
 
===How do I change the time stamp for each post from an AM/PM mode to a 24 hour mode?===
 
===How do I change the time stamp for each post from an AM/PM mode to a 24 hour mode?===
You set the '''Default Time Format''' for your blog via the [[Administration_Panels|Administration]] > [[Administration_Panels#General|Settings]] > [[Settings_General_SubPanel|General]] under the
+
<!-- 原題: How do I change the time stamp for each post from an AM/PM mode to a 24 hour mode? -->
[[Settings_General_SubPanel#Date_and_Time|Date and Time section.]]
+
You set the '''Default Time Format''' for your blog via the [[管理パネル|Administration]] > [[管理パネル#General|Settings]] > [[Settings General SubPanel|General]] under the
 +
[[Settings General SubPanel#Date and Time|Date and Time section.]]
  
 
See also:
 
See also:
217行目: 360行目:
  
 
===How can I have the date/time displayed on every entry I make?===
 
===How can I have the date/time displayed on every entry I make?===
To put the date and time on every post title on your site, you may have to change more than one [[Templates|template file]].  They may include <tt>index.php</tt>, <tt>single.php</tt>, <tt>category.php</tt>, and <tt>archives.php</tt>.  
+
<!-- 原題: How can I have the date/time displayed on every entry I make? -->
 +
To put the date and time on every post title on your site, you may have to change more than one [[テンプレート|template file]].  They may include <tt>index.php</tt>, <tt>single.php</tt>, <tt>category.php</tt>, and <tt>archives.php</tt>.  
  
 
From among the various template files, find all references to the title of your post like this (your Theme version may be slightly different):
 
From among the various template files, find all references to the title of your post like this (your Theme version may be slightly different):
247行目: 391行目:
  
 
===How do I change the "Permanent Link to" in my Title link?===
 
===How do I change the "Permanent Link to" in my Title link?===
 +
<!-- 原題: How do I change the "Permanent Link to" in my Title link? -->
 
The <tt>title</tt> of your links includes text that explains what the link is to, in concordance with web accessibility standards.  By default, your title may look like this example, which uses the <tt>title</tt> attribute with the words "Permanent Link to" and the template tag that displays the title of the post.
 
The <tt>title</tt> of your links includes text that explains what the link is to, in concordance with web accessibility standards.  By default, your title may look like this example, which uses the <tt>title</tt> attribute with the words "Permanent Link to" and the template tag that displays the title of the post.
  
275行目: 420行目:
 
   
 
   
 
===How do I make my Categories appear in alphabetical order?===
 
===How do I make my Categories appear in alphabetical order?===
 +
<!-- 原題: How do I make my Categories appear in alphabetical order? -->
 
In some cases it may be necessary to change  ''index.php''.  
 
In some cases it may be necessary to change  ''index.php''.  
  
Find this line:
+
Find this line:<!-- 注: list_cats は廃止予定のため、wp_list_categories に書き換えること -->
  
 
<pre><?php list_cats(0, 'All', 'name'); ?>
 
<pre><?php list_cats(0, 'All', 'name'); ?>
287行目: 433行目:
  
 
See also:
 
See also:
*[[Template Tags/wp_list_cats]] and [[Template Tags/list_cats]]
+
*[[テンプレートタグ/wp_list_categories]]<!-- 非推奨: [[Template Tags/wp_list_cats]] and [[Template Tags/list_cats]] -->
  
 
===How do I make my categories appear in a drop down list ?===
 
===How do I make my categories appear in a drop down list ?===
 +
<!-- 原題: How do I make my categories appear in a drop down list ? -->
  
 
In some cases it may be necessary to change  ''index.php''.  
 
In some cases it may be necessary to change  ''index.php''.  
297行目: 444行目:
 
<pre><?php list_cats(0, 'All', 'name'); ?></pre>
 
<pre><?php list_cats(0, 'All', 'name'); ?></pre>
  
and replace it with this line instead:
+
and replace it with this line instead:<!-- 注: dropdown_cats は廃止予定のため、wp_list_categories に書き換えること -->
 
<pre><form action="<?php echo $PHP_SELF ?>" method="get">
 
<pre><form action="<?php echo $PHP_SELF ?>" method="get">
 
<?php dropdown_cats(); ?>
 
<?php dropdown_cats(); ?>
304行目: 451行目:
  
 
See also:
 
See also:
*[[Template_Tags/dropdown_cats]]  
+
*[[テンプレートタグ/wp_dropdown_categories]]<!-- 非推奨: [[Template_Tags/dropdown_cats]] -->
  
 
===How do I exclude one or more categories from being listed in the list of categories?===
 
===How do I exclude one or more categories from being listed in the list of categories?===
 +
<!-- 原題: How do I exclude one or more categories from being listed in the list of categories? -->
 
Use the following function to list your categories but exclude category 1:
 
Use the following function to list your categories but exclude category 1:
 +
<!-- 注: wp_list_cats は廃止予定のため、wp_list_categories に書き換えること -->
  
 
<pre><?php wp_list_cats('exclude=1'); ?></pre>
 
<pre><?php wp_list_cats('exclude=1'); ?></pre>
320行目: 469行目:
  
 
See also:
 
See also:
*[[Template Tags/wp_list_cats]] and [[Template Tags/list_cats]]
+
*[[テンプレートタグ/wp_list_categories]]<!-- 非推奨: [[Template Tags/wp_list_cats]] and [[Template Tags/list_cats]] -->
  
 
===How do I hide a category from the front page ''index.php''?===
 
===How do I hide a category from the front page ''index.php''?===
 +
<!-- 原題: How do I hide a category from the front page ''index.php''? -->
 
If you need to exclude a category from the front page, you can place code that does the exclusion inside [[The Loop]] of your theme's <tt>index.php</tt> file.
 
If you need to exclude a category from the front page, you can place code that does the exclusion inside [[The Loop]] of your theme's <tt>index.php</tt> file.
  
357行目: 507行目:
  
 
===How do I make my Archives appear in a drop-down list?===
 
===How do I make my Archives appear in a drop-down list?===
 +
<!-- 原題: How do I make my Archives appear in a drop-down list? -->
 
Put this code into your ''index.php'' where you wish the item to appear:
 
Put this code into your ''index.php'' where you wish the item to appear:
  
374行目: 525行目:
  
 
===How can I customize the ''more'' tag?===
 
===How can I customize the ''more'' tag?===
 +
<!-- 原題: How can I customize the ''more'' tag? -->
 
See also:
 
See also:
*[[Customizing the Read More]]
+
*[[Customizing the Read More]]/[[:en:Customizing the Read More|en]]
 +
 
 +
<div id="Templates">
 +
 
 +
== テンプレート ==
 +
</div>
  
==Templates==
 
 
===Why can I see only n posts on the blog, where are the other entries?===
 
===Why can I see only n posts on the blog, where are the other entries?===
Make sure that you have the correct settings in the '''Show at most''' posts or days fields in the [[Administration Panels|Administration]] >  
+
<!-- 原題: Why can I see only n posts on the blog, where are the other entries? -->
[[Administration_Panels#Options_-_Configuration_Settings|Settings]] > [[Settings_Reading_SubPanel#Reading Options|Reading Panel]].
+
Make sure that you have the correct settings in the '''Show at most''' posts or days fields in the [[管理パネル|Administration]] >  
 +
[[管理パネル#Options - Configuration Settings|Settings]] > [[Settings Reading SubPanel#Reading Options|Reading Panel]].
  
If you are not seeing all your entries and you modified the default [[WordPress Files|index.php]], make sure you have an equal number of opening and closing tags, and that they are in the right places.
+
If you are not seeing all your entries and you modified the default [[WordPress Files|index.php]]/[[:en:WordPress Files|en]], make sure you have an equal number of opening and closing tags, and that they are in the right places.
  
 
===How do I create an archives page, with all the entries sortable by different methods?===
 
===How do I create an archives page, with all the entries sortable by different methods?===
 +
<!-- 原題: How do I create an archives page, with all the entries sortable by different methods? -->
 
See also:
 
See also:
*[[Creating an Archive Index]]
+
*[[Creating an Archive Index]]/[[:en:Creating an Archive Index|en]]
*[[Plugins]]
+
*[[プラグイン|Plugins]]
 
*[http://www.davidsaccess.com/?p=124 Another Nicer Archives Version]
 
*[http://www.davidsaccess.com/?p=124 Another Nicer Archives Version]
 
*[http://www.sporadicnonsense.com/2005/04/28/clean-archives-plug-in/ Sporadic Nonsense's Clean Archives Plugin]
 
*[http://www.sporadicnonsense.com/2005/04/28/clean-archives-plug-in/ Sporadic Nonsense's Clean Archives Plugin]
  
 
===What do the _() and _e() functions in WordPress do?===
 
===What do the _() and _e() functions in WordPress do?===
 +
<!-- 原題: What do the _() and _e() functions in WordPress do? -->
 
In the simplest of terms, they "print" what you tell them to do. They are abbreviations for the PHP term "echo" which displays text. In WordPress, they are used to identify strings in the php files marked for translation to other languages, and localization using two "tags" which are actually functions. They are:
 
In the simplest of terms, they "print" what you tell them to do. They are abbreviations for the PHP term "echo" which displays text. In WordPress, they are used to identify strings in the php files marked for translation to other languages, and localization using two "tags" which are actually functions. They are:
 
* __()  
 
* __()  
408行目: 567行目:
 
*[[Conditional Tags]]
 
*[[Conditional Tags]]
  
==Themes==
+
<div id="Themes">
 +
== テーマ ==
 +
</div>
 
===How do I use a Theme style from Alex King’s site?===
 
===How do I use a Theme style from Alex King’s site?===
 +
<!-- 原題: How do I use a Theme style from Alex King’s site? -->
 
See also:  
 
See also:  
*[[Using Themes]]
+
*[[テーマの使い方]]
*[[Using Themes/Theme List]]
+
<!-- *[[Using Themes/Theme List]] 削除されたページなのでコメントアウト-->
 
* [http://www.alexking.org/blog/2005/02/27/wordpress-theme-competition/ Alex Kings Theme Competition]
 
* [http://www.alexking.org/blog/2005/02/27/wordpress-theme-competition/ Alex Kings Theme Competition]
  
 
===Which files do I modify when I start to design my site?===
 
===Which files do I modify when I start to design my site?===
 +
<!-- 原題: Which files do I modify when I start to design my site? -->
 
See also:
 
See also:
*[[Working_with_WordPress#Site_Development|Working with WordPress, Site Development]]
+
*[[Working with WordPress#Site Development|Working with WordPress, Site Development]]/[[:en:Working with WordPress#Site Development|en]]
  
 
===How do you create a screenshot.png for your Theme?===
 
===How do you create a screenshot.png for your Theme?===
 +
<!-- 原題: How do you create a screenshot.png for your Theme? -->
 
See also:
 
See also:
 
*[http://www.tanster.com/?p=162 Tanster's Quick and dirty way to create screenshot.png]
 
*[http://www.tanster.com/?p=162 Tanster's Quick and dirty way to create screenshot.png]
425行目: 589行目:
 
[[FAQ|Back to FAQ]]
 
[[FAQ|Back to FAQ]]
  
[[Category:Design and Layout]]
+
{{原文|FAQ Layout and Design|55975}}<!-- 14:42, April 4, 2008 Stevish 版 -->
[[Category:Troubleshooting]]
+
 
[[Category:WordPress Help]]
+
{{DEFAULTSORT:FAQれいあうととてさいん}}
 +
[[Category:デザインとレイアウト]]
 +
[[Category:トラブルシューティング]]
 +
[[Category:WordPress ヘルプ]]
 +
 
 +
[[en:FAQ Layout and Design]]

2016年11月11日 (金) 14:18時点における最新版

このページ「FAQ/レイアウトとデザイン」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

目次

レイアウトとスタイル

CSSでトラブルがあったときはどこを見ればいいですか?

The following are articles that will help you troubleshoot and solve many of your CSS problems:

How can I choose different styles or colours for my comments?

There are a variety of WordPress Plugins that change the look, layout, and colors of your comments and comment form. Look for various Comments Plugins in the Official WordPress Plugin Directory.

ポップアップコメントのウインドウの大きさはどのように変えるのですか?

WordPress バージョン1.5におけるポップアップ・コメント・ウインドウのサイズ調整は comment-functions.php ファイルを変更します。同ファイルの function comments_popup_script($width=400, $height=400, $file=) {. をご参照下さい。

WordPress バージョン1.2.1 Mingus におけるポップアップ・コメント・ウインドウのサイズ調整は template-functions-comment.php の50行目を変更して下さい。

function comments_popup_script($width=400, $height=400, 
$file='wp-comments-popup.php')

wp-comments-popup.php の81行目を変更することで、textarea のサイズ変更も可能です。

Where can I find some other Themes and templates to use for styling my blog?

See テーマの使い方

Where can I find information about styling lists and nested lists?

See Styling Lists with CSS/en

How do I change the way menu links are listed?

See Styling Lists with CSS/en

How do I get rid of the bullet points next to my links?

See Styling Lists with CSS/en

How can I create horizontal menus?

See Creating Horizontal Menus/en

How can I get my categories to display in the order I want?

Two tags are involved in generating your category list. For more information on setting the order and look of these see wp_list_categories().

How can I get my links to open in a new window?

Opening links in a new window is considered bad form in today's web as it has been abused. Yet, it still serves a purpose for demonstration sites that require more than one window open at a time. This method will work for those links that you enter into the body of a post.

After entering the link using the Quicktags button for "link", add target="_blank" to the individual*- link you want to have open in a new window when clicked. Consider adding text indicating that this link will open a new window, as required by web accessibility standards.

<a href="http://example.com/page.php" 
title="Page Title - opens in new window" target="_blank">
Page Title (Opens in new window)</a>

Is there a tool to encode HTML entities and tags so I can display code on my weblog?

The article Writing Code in Your Posts/en will help you write programming code and code examples in your posts. The Encode tool will convert your HTML/XHTML code into a form that can be displayed on your blog without it being treated as HTML by browsers.

There are also WordPress Plugins and other tools available to help integrate this proces into your site if you use it frequently to display code.

Also see: Fun Character Entities/en

How do I do a dropcaps on the first letter of a post?

DropCaps is the name for the effect where the first letter of the first paragraph in an article drops below the line of text, and is displayed in a larger font-size than the other normal letters.

This can be done using BBCode quicktags. First, add this to your style sheet:

 #fp:first-letter {
 font-size : 300%;
 font-weight : bold;
 float : left;
 margin-right: 3px;
 }

then add following code to file /wp-includes/js/quicktags.js and put them among edButtons:

 edButtons[edButtons.length] =
 new edButton('ed_capdrop'
 ,'CapDrop'
 ,'<p id="fp">'
 ,'</p>'
 ,'c'
 );

You will now see a CapDrop quicktag in your edit window.

See also:

Where should I look for more information on CSS?

See CSS/en

どうやって自分のコメントに異なるスタイルや色を付けたらいいの?

WorldPress にはコメントやフォームの見た目、レイアウト、色を変更する様々なプラグインがあります。次のページからプラグインを探せばいいよ。Official WordPress Plugin Directory

How do I change the size of the popup comments window?

To change the look of the Popup Comments window in WordPress version 1.5, make changes to the comment-functions.php file where it shows the following line: function comments_popup_script($width=400, $height=400, $file=) {.

To change the look of the Popup Comments window in WordPress version 1.2.1 Mingus, make the following change to the template-functions-comment.php on line 50:

function comments_popup_script($width=400, $height=400, 
$file='wp-comments-popup.php')

You can also change Line 81 of wp-comments-popup.php to alter the textarea size for people entering comments.

Where can I find some other Themes and templates to use for styling my blog?

See テーマの使い方

Where can I find information about styling lists and nested lists?

どこででスタイルシートやネストしたリストについての情報を得ることができますか? See Styling Lists with CSS/en

How do I change the way menu links are listed?

See Styling Lists with CSS/en

How do I get rid of the bullet points next to my links?

See Styling Lists with CSS/en

How can I create horizontal menus?

See Creating Horizontal Menus/en

How can I get my categories to display in the order I want?

Two tags are involved in generating your category list. For more information on setting the order and look of these see wp_list_categories().

How can I get my links to open in a new window?

Opening links in a new window is considered bad form in today's web as it has been abused. Yet, it still serves a purpose for demonstration sites that require more than one window open at a time. This method will work for those links that you enter into the body of a post.

After entering the link using the Quicktags button for "link", add target="_blank" to the individual*- link you want to have open in a new window when clicked. Consider adding text indicating that this link will open a new window, as required by web accessibility standards.

<a href="http://example.com/page.php" 
title="Page Title - opens in new window" target="_blank">
Page Title (Opens in new window)</a>

Is there a tool to encode HTML entities and tags so I can display code on my weblog?

The article Writing Code in Your Posts/en will help you write programming code and code examples in your posts. The Encode tool will convert your HTML/XHTML code into a form that can be displayed on your blog without it being treated as HTML by browsers.

There are also WordPress Plugins and other tools available to help integrate this proces into your site if you use it frequently to display code.

Also see: Fun Character Entities/en

How do I do a dropcaps on the first letter of a post?

DropCaps is the name for the effect where the first letter of the first paragraph in an article drops below the line of text, and is displayed in a larger font-size than the other normal letters.

This can be done using BBCode quicktags. First, add this to your style sheet:

 #fp:first-letter {
 font-size : 300%;
 font-weight : bold;
 float : left;
 margin-right: 3px;
 }

then add following code to file /wp-includes/js/quicktags.js and put them among edButtons:

 edButtons[edButtons.length] =
 new edButton('ed_capdrop'
 ,'CapDrop'
 ,'<p id="fp">'
 ,'</p>'
 ,'c'
 );

You will now see a CapDrop quicktag in your edit window.

See also:

CSS についてもっと詳しく調べたい時はどこを参照すればいいでしょうか?

See CSS/en

テキストとコンテンツ表示

ウェブログのホームページで記事のタイトルのみ表示する

ェブログのホームページに投稿のタイトルのみを表示するには, index.php の中を置き換えます

<?php the_content(); ?>

With something like:

<?php
if (is_single()) {
the_content();
}
else {//no content, nothing.
}
?>

これは個人の投稿ページのみに投稿内容が表示されます。

ブログロールのリンク評価機能を使用して評価を表示する方法

WordPress1.5以降にはリンクマネージャー(ブログロール)で評価を参照表示するオプションがあります。

To rate your links, edit the particular link (by using the "Links" editing interface, or "Blogroll" in later versions of WordPress -- rating is in the Advanced section), and rate the link from 0 - 10 using the dropdown menu.

To get your link ratings to display, you may need to edit your Theme. See the documentation for the wp_list_bookmarks() or get_links() Template Tags for more information.

In WordPress 1.2, the procedure is slightly different. First, for each link category, you have to turn on the display of link ratings (Links -> Link Categories -> Show -> Rating).

Once that is done, you can display the ratings by changing the settings in the Options -> Link Manager screen:

  • a character (* by default)
  • a number (the rating, 0-9)
  • images -- if you are using Images, you have the choice of using the same image displayed n times to show a rating of n, or using 10 different images, for one through 10.

How do I show an excerpt or teaser for an article on the weblog homepage?

An excerpt should not be confused with the teaser which refers to the first few sentences or paragraphs of a post. When typing a long post you can insert the <!--more--> Quicktag/en after a few sentences to act as a cut-off point. When the post is displayed on a category page, archive page, or home page, the teaser is displayed, followed by a hyperlink (such as Read the rest of this entry...). Your visitor can then click on that link to see the full version of your post.

Note that some Themes do not support the more ability. More information on how to present the more information can be found at Template Tag the_content() and Customizing the Read More/en.

As stated before, recognize that use of the more feature should not be confused with the Excerpt field in your Administration > Write > Write Post Panel/en. The Template Tag the_excerpt() can be used to access the contents of this field (i.e. the excerpt you enter in your blog will not be used for anything unless you have the_excerpt in your theme, or you choose to include excerpts only in your RSS fields).

How do I customise the text shown in "(more.....)" on my weblog?

See Customizing the Read More/en

Images and Graphics

How to add a favicon to your site

To add a favicon to your site in WordPress 2.0, place your favicon.ico file inside your theme folder (for example: wp-content/themes/default/) then add this line to header.php:

<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />

Be sure to add it somewhere within the <head></head> section.

See Creating and Installing a Favicon/en For more detailed instructions.

Where can I get some buttons for my site?

Buttons are like badges you display on your website to show your affection for something, or to display information regarding your cultural, social, political or technical leanings.

To add a WordPress button to your site showing support for the WordPress Community:

For more buttons, see:

How do I get WordPress to generate links to the thumbnail of an uploaded picture?

WordPress by default only produces very limited code after uploading a picture. If you want to get code for the thumbnail link, the thumbnail etc, autogenerated, the following resources will be useful, including a possible hack that may not work for WordPress v1.5 at Thumbnail HTML addition for upload.php.

See also:

How can I use a custom image for my list bullets?

See also:

How do I rotate/cycle/randomize the image in the header of the weblog?

See also:

How do I link to my own images?

You can use absolute or relative URI/URLs addresses.

To use a relative link, set the address from the root folder of your site by using a slash in front of the folder in the root directory.

<img src="/images/balloons/image.jpg" alt="balloons" />

To use an absolute link:

<img src="http://www.example.com/images/balloons/image.jpg" alt="balloons" />

How can I display images in my category and archive pages?

When using the default theme, you'll notice images (and links) do not appear when visiting category and archive query pages. This has to do with how the default theme displays post content in those sections of your blog. To change this behavior, edit the default theme's Archive Template (archive.php). You can do this online through the Theme Editor, or offline by downloading and opening the default theme's archive.php in any text editor. Once in the Archive Template, look for this section:

<div class="entry">
    <?php the_excerpt() ?>
</div>

Here, change the_excerpt() template tag, which displays a summary of a post's content while filtering out all HTML tags. To display each post's whole content (and HTML tags), use the_content() template tag:

<div class="entry">
    <?php the_content(); ?>
</div>

Where can I find more information on images, PhotoBlogs, and photo galleries?

See also:

テンプレートタグ

How do I change the time stamp for each post from an AM/PM mode to a 24 hour mode?

You set the Default Time Format for your blog via the Administration > Settings > General under the Date and Time section.

See also:

How can I have the date/time displayed on every entry I make?

To put the date and time on every post title on your site, you may have to change more than one template file. They may include index.php, single.php, category.php, and archives.php.

From among the various template files, find all references to the title of your post like this (your Theme version may be slightly different):

<h2>
<a href="<?php the_permalink() ?>" rel="bookmark" 
title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?></a>
</h2>
<small>
<?php the_time('F jS, Y') ?> by <?php the_author() ?>
</small>

Rearrange it so the time information goes in front (or in back) of your Post Title:

<h2>
<a href="<?php the_permalink() ?>" rel="bookmark" 
title="Permanent Link to <?php the_title(); ?>">
<?php the_time('F jS, Y') ?> - <?php the_title(); ?></a>
</h2>
<small>
by <?php the_author() ?>
</small>

See also:

How do I change the "Permanent Link to" in my Title link?

The title of your links includes text that explains what the link is to, in concordance with web accessibility standards. By default, your title may look like this example, which uses the title attribute with the words "Permanent Link to" and the template tag that displays the title of the post.

<h2>
<a href="<?php the_permalink() ?>" rel="bookmark" 
title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?></a>
</h2>

To change the "Permanent Link to" text, simply delete it and replace it with your own words:

<h2>
<a href="<?php the_permalink() ?>" rel="bookmark" 
title="Post about <?php the_title(); ?>">
<?php the_title(); ?></a>
</h2>

Or remove it completely, leaving only the title tag.

<h2>
<a href="<?php the_permalink() ?>" rel="bookmark" 
title="<?php the_title(); ?>">
<?php the_title(); ?></a>
</h2>

How do I make my Categories appear in alphabetical order?

In some cases it may be necessary to change index.php.

Find this line:

<?php list_cats(0, 'All', 'name'); ?>

and replace it with this line instead:

<?php list_cats(0,'','name','','',true,0,1,1,1); ?>

See also:

How do I make my categories appear in a drop down list ?

In some cases it may be necessary to change index.php.

Find this line:

<?php list_cats(0, 'All', 'name'); ?>

and replace it with this line instead:

<form action="<?php echo $PHP_SELF ?>" method="get">
<?php dropdown_cats(); ?>
<input type="submit" name="submit" value="view" />
</form>

See also:

How do I exclude one or more categories from being listed in the list of categories?

Use the following function to list your categories but exclude category 1:

<?php wp_list_cats('exclude=1'); ?>

Of course, change the 1 to the ID of the category you want to exclude.

To exclude multiple categories, use this:

<?php wp_list_cats('exclude=1, 2'); ?>

Change 1 and 2 to the categories you want excluded. You can exclude more of them by adding their IDs separated by commas.

See also:

How do I hide a category from the front page index.php?

If you need to exclude a category from the front page, you can place code that does the exclusion inside The Loop of your theme's index.php file.

The Loop starts something like this:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

To exclude category 4 from the front page, just inside The Loop, add this condition :

<?php if ( !(in_category('4')) || !is_home() ) { ?>
<!-- Output the post here -->

The Loop ends something like this:

<?php endwhile; ?>

Just before that line, add this:

<?php } ?>

In the end, it will look like:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( !(in_category('4')) || !is_home() ) { ?>
<!-- Output the post here -->
<?php } ?>
<?php endwhile; ?>

This means that if on the front page, the post will be presented if it's not in category 4. On pages other than the front ( home ) page, all posts are presented.

See also:

How do I make my Archives appear in a drop-down list?

Put this code into your index.php where you wish the item to appear:

<li id="archives">Archives:
<ul>
<li><form name="archiveform" action="">
<select name="archive_chrono" onchange="window.location =
  (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">
<option value=''>By Month</option>
< ?php get_archives('','','option', 1); ?>
</></select>
</form>
</li>
</ul></li> 

How can I customize the more tag?

See also:

テンプレート

Why can I see only n posts on the blog, where are the other entries?

Make sure that you have the correct settings in the Show at most posts or days fields in the Administration > Settings > Reading Panel.

If you are not seeing all your entries and you modified the default index.php/en, make sure you have an equal number of opening and closing tags, and that they are in the right places.

How do I create an archives page, with all the entries sortable by different methods?

See also:

What do the _() and _e() functions in WordPress do?

In the simplest of terms, they "print" what you tell them to do. They are abbreviations for the PHP term "echo" which displays text. In WordPress, they are used to identify strings in the php files marked for translation to other languages, and localization using two "tags" which are actually functions. They are:

  • __()
  • _e()

These accept a string as an argument. For example:

__("Translate Me")
_e("Translate Me")

The only functional difference between the two methods is that _e() echoes the string and () simply returns the string. () is used when you want to supply a string to a function. _e() is used when you want to output the string as part of your XHTML.

We have a tool which goes through all of the php files, extracting strings that are marked by __() and _e().

See also:

テーマ

How do I use a Theme style from Alex King’s site?

See also:

Which files do I modify when I start to design my site?

See also:

How do you create a screenshot.png for your Theme?

See also:

Back to FAQ

最新英語版: WordPress Codex » FAQ Layout and Design最新版との差分