Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressテーマで投稿抜粋を表示する方法

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

WordPressテーマで投稿抜粋を表示する方法を知りたいですか?

ブログで記事全文の代わりに投稿の抜粋を表示することで、訪問者が興味深いコンテンツを素早く見つけ、サイトの読み込み時間を短縮することができます。

この投稿では、WordPressテーマに投稿抜粋を簡単に追加する方法をご紹介します。

How to display post excerpts in WordPress themes

なぜWordPressで抜粋投稿を表示するのか?

初期設定では、WordPressはサイト全体のトップページ、ブログページ、アーカイブページに投稿の全文を表示します。しかし、これは様々な投稿をクイックブラウズし、最初に読みたい投稿を見つけたいユーザーにとって最高のエクスペリエンスではありません。

また、スクロールが多くなることもあり、スマートフォンやタブレットのユーザーにとっては大きな問題となる。

より多くの投稿を公開すると、WordPressはページ送りを使ってブログを複数のページに分割することもあります。過去の投稿が他のページにプッシュされるにつれて、表示回数やエンゲージメントが減ることがよくあります。

そのため、多くのブログのオーナーは、アーカイブやブログのインデックスページに投稿日: を抜粋して表示しています。各投稿の一部だけが読み込まれるため、WordPressのスピードとパフォーマンスが向上します。

An example of post excerpts in a WordPress theme

WordPressには投稿抜粋のビルトインサポートがありますが、すべてのテーマがこの機能を利用しているわけではありません。

それでは、WordPressテーマで投稿抜粋を表示する方法を紹介しよう。

WordPressテーマが抜粋投稿に対応しているか確認する方法

ほとんどの人気WordPressテーマには、投稿の全文ではなく抜粋を表示する設定があります。

お使いのテーマが投稿抜粋に対応しているかどうかを確認するには、WordPressダッシュボードの外観 ” カスタマイズページにアクセスしてください。

これらの設定の場所はWordPressのテーマによって異なりますが、「Blog」と表示されている設定を探す必要があります。

Adding post excerpts to a WordPress theme using the Customizer

例えば、Astra WordPressテーマを使用している場合、「ブログ」を選択し、「ブログ/アーカイブ」をクリックする必要があります。

投稿要素」セクションまでスクロールダウンし、「抜粋」タブを展開します。そうしたら、「抜粋」オプションを選択します。

Adding post excerpts to your WordPress website

もしあなたのテーマに「テーマ設定」または「投稿一般設定」オプションがあれば、これらのセクションで投稿抜粋を有効化できるかもしれません。

それができたら、「公開する」ボタンをクリックするだけだ。これで、ブログ、アーカイブ、ホームページにアクセスすると、全投稿ではなく抜粋のリストが表示されるはずです。

もしあなたのテーマに抜粋投稿のビルトインサポートがない場合は、追加する必要があります。以下のクイックリンクを使用して、使用したい方法にジャンプするだけです:

方法1:コードを使ってWordPressに投稿抜粋を追加する(簡単)

WordPressテーマが初期設定で抜粋投稿をサポートしていない場合は、手動でこの機能を追加することができます。

WordPressテーマのファイルを直接編集することもできますが、代わりに子テーマを作成することをお勧めします。そうすることで、WordPressテーマを更新した際に、変更した内容が失われることがなくなります。

詳しくは、初心者向けWordPress子テーマの作成方法をご覧ください。

そうしたら、投稿抜粋を表示したい各ページをコントロールするテンプレートを見つける必要がある。ほとんどのテーマでは、home.phpcontent.phpcategory.phparchive.phpになります。

正しいファイルの見つけ方については、初心者向けWordPressテンプレート階層ガイドをご覧ください。

それが済んだら、各ファイルの中に以下のコードを見つけるだけだ:

<?php the_content(); ?>

次に、このコードを_excerptタグに置き換える:

<?php the_excerpt(); ?>

ファイルを保存し、サイトを確認してください。投稿の抜粋が表示されるはずです。

WordPressの抜粋の初期設定を変更する

初期設定では、WordPressは各投稿の最初の55語を表示し、さらにコンテンツがあることを示すために省略記号(…)を追加します。

WordPressサイトにコードを追加することで、より多くの単語を表示したり、より少ない単語を表示したりすることができます。テーマファイルを直接編集することも可能ですが、これは複雑です。

単純なミスがWordPressの一般的なエラーを引き起こし、サイトを完全に壊してしまうこともあります。

そのため、WPCodeの使用をお勧めします。テーマファイルを編集することなく、WordPressにコードスニペットを簡単に追加できる。これにより、カスタムコードを失うことなくテーマの更新や変更が可能になります。

まず、無料のWPCodeプラグインをインストールし、有効化する必要があります。詳しくは、WordPressプラグインのインストール方法についての初心者ガイドをご覧ください。

有効化したら、WordPressダッシュボードからCode Snippets ” + Add Snippetのページにアクセスし、’Add Your Custom Code (New Snippet)’オプションの下にある’Use Snippet’ボタンをクリックします。

How to show post excerpts using code

次の画面で、コード・スニペットのタイトルを入力する。これは参考用なので、好きなものを使ってください。

その後、「コードタイプ」のドロップダウンを開き、「PHPスニペット」を選択する。

Customizing your post excerpts using code

そうしたら、コードエディターに以下を貼り付けるだけだ:

return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');

// Changing excerpt more
function new_excerpt_more($more) {
return '...';
}
add_filter('excerpt_more', 'new_excerpt_more');

このコードは投稿抜粋の長さを100文字に変更します。100」は好きな数字に変更できます。

コードを貼り付けたら、右上のスイッチを「非有効化」から「有効化」に切り替え、「スニペットを保存」ボタンをクリックする。

Save and activate code snippet WPCode

投稿日抜粋を微調整する方法については、コードなしでWordPress抜粋をカスタマイズする方法をご覧ください。

方法2:フルサイトエディターを使って投稿抜粋を追加する(ブロックテーマのみ)

新しいブロックWordPressテーマのいずれかを使用している場合は、完全なサイトエディタを使用して投稿抜粋を追加することができます。

始めるには、WordPressダッシュボードの外観 ” エディターへ向かいます。

Using the full-size editor (FSE)

初期設定では、フルサイトエディターはテーマのホームテンプレートを表示しますが、どのテンプレートにも抜粋を追加することができます。

左側のメニューで『テンプレート』をクリックするだけだ。

Displaying post excerpts in WordPress using the full-site editor (FSE)

WordPressテーマを構成するすべてのテンプレートのリストが表示されます。テーマによっては、アーカイブ、インデックス、検索、または同様のテンプレートに抜粋を追加したい場合があります。

編集したいテンプレートを見つけてクリックするだけ。

Displaying post excerpts using the WordPress full-site editor (FSE)

WordPressはこのテンプレートのプレビューを表示します。

テンプレートを編集するには、小さな鉛筆のアイコンをクリックします。

Displaying post excerpts using the WordPress full-site editor (FSE)

ここで「+」アイコンをクリックする。

表示された検索パネルで、「投稿抜粋」と入力する。

Adding the post excerpt block to a block-based WordPress theme

適切なブロックが外観に表示されたら、レイアウトにドラッグ&ドロップします。

テンプレートに複数の投稿抜粋を追加するには、このプロセスを繰り返すことができます。

Adding the post excerpt block to a block-based WordPress theme

抜粋の見え方を微調整するには、投稿抜粋ブロックをクリックして選択するだけです。

右側のメニューでは、まず「Show link on new line」トグルを使って、「Read More」リンクを抜粋と同じ行に表示するかどうかを選ぶことができる。

Adding a read more button to a blog archive page

それが終わったら、「スタイル」タブを選択します。ここでは、文字色の変更、背景色の追加、フォントサイズの変更などができます。

変更を加えると、ライブプレビューが自動的に更新されるので、さまざまな設定を試して、最適な設定を確認することができます。

How to customize a WordPress post excerpt

投稿抜粋の設定に満足したら、’Save’ボタンをクリックして変更を有効にします。

より多くのページや投稿日に抜粋投稿を表示したいですか?その場合は、上記の手順を繰り返しますが、今回は左側のメニューから新しいテンプレートを選択します。

方法3:テーマビルダーを使ってWordPressに投稿抜粋を追加する(上級者向け)

アーカイブ、ブログページ、ホームページ、その他のサイトの外観を完全にコントロールしたい場合は、カスタマイザーを作成することができます。

これにより、独自のページをデザインし、抜粋をサイト上のどこにでも表示することができる。

SeedProdは、コードを書くことなく簡単にカスタマイWordPressテーマを作成することができます最高のWordPressテーマビルダーです。また、任意のページにドラッグ&ドロップできる既製の投稿ブロックを持っています。

注: 無料のSeedProdプラグインがあり、予算に関係なく、美しい近日公開ページやメンテナンスモードページを 作成することができます。ただし、テーマビルダーをアンロックするには、SeedProd ProまたはEliteプランが必要です。

まず、SeedProdプラグインをインストールして有効化する必要があります。詳しくは、WordPressプラグインのインストール方法のステップバイステップガイドをご覧ください。

有効化したら、SeedProd ” 設定ページに行き、プラグインのライセンスキーを入力してください。この情報はSeedProdサイトのあなたのアカウントにあります。

Adding a SeedProd license key to WordPress

ライセンスキーを入力した後、SeedProdテーマビルダーを使用してカスタムWordPressテーマを作成する準備が整いました。

まず、SeedProd ” Theme Builderのページに行く必要があります。

The SeedProd theme builder

ここでは、既製のSeedProdサイトキットとテンプレートのいずれかを出発点として使用するか、または手動で一からテンプレートを作成することができます。

既存のテーマから始めることをお勧めします。必要なテンプレートファイルがすべて自動的に作成され、スタートダッシュを切ることができるからです。

ということで、「テーマテンプレートキット」ボタンをクリックします。

Creating a custom WordPress theme using SeedProd

利用可能なテンプレートのいずれかを選択することができます。

これらのテーマはすべてカスタマイズ可能なので、WordPressブログやサイトにぴったり合うように微調整することができます。

Choosing a theme template for your WordPress website or blog

テーマを選択すると、SeedProdは必要なテーマテンプレートをすべて自動的に作成します。

これはカスタムWordPressテーマの下書きバージョンと考えることができます。

Customizing the blog, archive, and search pages using SeedProd

SeedProdのドラッグ&ドロップエディターを使って、各テンプレートをカスタマイズできるようになりました。

サイトに投稿抜粋を追加したいので、「Blog Index, Archives, Search」 テンプレートにマウスオーバーし、「Edit Design」リンクが表示されたらクリックする。

How to add post excerpts to your WordPress theme with SeedProd

SeedProdドラッグ&ドロップビルダーがロードされます。

右側にテンプレートのプレビューが表示されます。初期設定では、ブログページテンプレートは見出し、アーカイブ、タイトル、すべての投稿を表示します。

The SeedProd drag and drop theme editor and page builder

左側にはメニューが表示され、使用できるすべてのブロックが表示されます。

新しいブロックをページにドラッグして追加し、マウスで上下にドラッグして並べ替えることができます。

ブロックをクリックし、左側メニューの設定を使用することで、ブロックをカスタマイザーすることができます。変更を加えると、SeedProdのプレビューが自動的に更新され、変更内容が表示されます。

How to customize any block in a WordPress theme

投稿抜粋をカスタマイズしたいので、ライブプレビューで「投稿」ブロックをクリックして選択するだけです。

その後、左側のメニューにある設定を使って、このブロックに表示したいコンテンツを選択します。

例えば、カラムレイアウトの変更、ページ送り、アイキャッチ画像の表示、タイトルタグの変更などが可能です。

How to add post excerpts to a WordPress theme without writing code

投稿抜粋を表示するには、’Show Excerpt’トグルをオレンジ色になるようにクリックするだけです。

それができたら、「抜粋の長さ」に新しい数字を入力することで、SeedProdが抜粋に表示する文字数を変更することができます。

Adding blog excerpts to a WordPress theme

また、SeedProdは各抜粋に「続きを読む」リンクを追加することができ、読者に記事全文を開いてもらうことができます。

続きを表示」トグルを使って、このリンクを追加または削除することができます。

Adding a 'Read More' button to your post excerpts

また、「続きを読むテキスト」フィールドに入力することで、「続きを読む」テキストを独自のメッセージに置き換えることもできます。

投稿抜粋の設定に満足したら、画面右上の「保存」ボタンをクリックします。

Customizing the 'Read More' link in a post excerpt

SeedProd” Theme Builderに移動し、上記と同じ手順で他のSeedProdテンプレートをカスタマイズすることができます。

投稿の抜粋を訪問者に表示するには、まずSeedProdテーマを有効化する必要があります。これを行うには、SeedProd ” Theme Builderに 行き、’SeedProdテーマを有効化’トグルをクリックして’はい’と表示されるようにします。

How to enable a custom WordPress theme using SeedProd

これで、あなたのブログページにアクセスすると、投稿抜粋がライブで表示されます。

ボーナス:パスワードで保護されたコンテンツの抜粋表示

会員制サイトを運営している場合、一般の視聴者が閲覧できないコンテンツがあるかもしれません。しかし、パスワードで保護されたコンテンツの抜粋を表示するのは良いアイデアです。

これはユーザーの興味をそそり、あなたのサイトの限定コンテンツにアクセスするための定期購読の購入を促すことができる。

人気のコンテンツ保護プラグインであるRestrict Content Proを使用すると、簡単にこれを行うことができます。有効化したら、WordPressのブロックエディターでお好みの投稿を開き、ブロックパネルから抜粋を追加するだけです。

その後、ドロップダウンメニューから制限を設定することができます。

Add an excerpt for the restricted post

最後に投稿を公開し、WordPressサイトにアクセスしてください。

ここでは、ユーザーは他の投稿と同じように、制限されたコンテンツの投稿抜粋とタイトルを見ることができます。しかし、コンテンツ自体は非表示になります。

Protected content excerpt preview

詳しい手順については、WordPressでパスワードで保護された投稿の抜粋を表示する方法のチュートリアルもご覧ください。

この投稿が、WordPressテーマで投稿抜粋を表示する方法を学ぶのにお役に立てば幸いです。また、WordPressでオンラインブログでお金を稼ぐ方法についてのガイドと、専門家が選ぶWordPressのベストSEOプラグインとツールもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

94件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Manasi says

    for the plane these this is what worked for me – Go to the home page and clkick edit. Go to the block editor and click on the block – Blog Posts. You will seea setting which states ‘post control settings’

    There you can enable or disable the show excerpt setting

  3. Dicado says

    Hi thanks for this. I don’t have those files in my child theme. If I just go ahead and do this in my parent theme, won’t it be erased if there is an update?

    • WPBeginner Support says

      Correct, if you place it in your parent theme and the parent theme is updated your changes would be lost

      管理者

  4. John says

    Thanks for this post. I also want to ask for help on how to add padding around excerpt. I have added border lines around my excerpt; the problem is the excerpt is touching the borderlines. How do I add padding around the excerpts, preventing it from touching the borderlines? Thanks in advance.

  5. Atul Jagtap says

    Hi their,
    I am using ‘Enlightenment’ theme but I have a problem that in my post I can’t see the short Post Excerpt ie it’s come blank. And this happened only with ‘Enlightenment’ this theme. Because same code I am using in other theme is working fine. So is anybody give me solution on this?

  6. Sara Pedersen says

    Hello

    I have custom excerpt in the excerpt box for each post. They are a photo link. This has worked for several years and the photo is at the top of the post with the post link below. Suddenly the last 2 posts the excerpt photo is not posting. Any tips to fix this?

  7. Siddhesh says

    Hi,

    I can locate index.php and categories.php in my theme folder but i dont find the mentioned syntax. How do i fix this?

    -Siddhesh

  8. Francesco says

    Hi, maybe my question will sound silly to you but… I never installed WordPress on a server/host, I just suscribed and got the .wordpress.com domain, everything was automatic. So, how can I access these files? I read in the comments about the FTP protocol, which I am familiar with, but who gives the information to enter in the domain with that?

    And while we’re at it, do you suggest to install wordpress by yourself (online I see there are a lot of tutorials and seems easy to do) or continuing as I am doing on the .wordpress.com domain? Maybe one day I will buy the premium and have a direct domain, but besides that, are there any advantages in terms of functionality in installing manually?

  9. Joseph Dabon says

    Very simple, huh! But where can I find these? – index.php file, archive.php file, and category.php

    • Javier says

      Hi, you can find those files using a FTP account.

      When you get in to your server files, get in into this route:
      wp-content/themes/ your-theme-name /

      And you will find the files

  10. Tolu says

    Hi there,
    My theme doesn’t support excerpts on the homepage, i’ve enabled excerpts on the blog post and its still not showing on the homepage, i’m not a php pro so i don’t know my way around it.

    Any help would be appreciated.

  11. Sreeharsh says

    Hi, My theme doesn’t support excerpts in the posts page.
    Can you please help me to enable it to display under my page title.
    Thank you. :D

  12. javad says

    hi
    my theme have excerpts option and i enabled it

    and i want to show my post images above this excerpts on index,php

    i used Auto Post Thumbnail and Featured Image plugins

    but i dont know code to show Thumbnail above the posts

  13. Dorine Ogutu says

    Hello, I am a beginner and I am using the Nucleare theme. I can’t find the index.php file. Please help.

    Desparate

    • Constantine says

      You will need to open either the terminal or your cPanel (if you’re using a shared host and it provides this feature), find your wordpress directory, and under the directory there’ll be a folder called “wp-content”, then enter “themes”, and then find the one folder that the name is your currently using one.

      If you’re using a terminal,

      type

      cd /…/…/wp-content/themes/

      and use cd to enter your themes folder that’s where your index.php lies. “…” here means your previous directory of your wordpress root directory, you will need to find that yourself and figure out what it is first you installed your wordpress on your server.

      Not sure if this helps since it’s been awhile, i’m a newbie myself so hope it might help you and others.

  14. Chris says

    I’ve just updated to a responsive theme and all the posts were in excerpt form. From reading this column I was able to change them to full content. What I’d really like is to have my current post in full content mode, so my followers see it as soon as they get on my site, and the older posts in excerpt form, so that the site loads more quickly. Is this possible? Thanks for your help!

    • James says

      @Chris, I’m trying to do the same thing. Did you figure this out (how to show the latest post in full mode, and the rest as “excerpts”)?

  15. Gaurav says

    I am using custom excerpts from wordpress. It is displayed on my home page. But it is not displayed on my original post. I want to display this excerpt just before my actual post with different font styles and font colour.
    Is there a way to do that ?

  16. pase says

    Trying to display a list blog excerpt summary after the blog introduction. Created a custom template for the blog front page. How can I call the blog excerpt summary page from the custom template?

  17. Drew says

    you know there’s a plugin that can resolve this. with ANY tutorials, it’s never 100% clear because there are files or scripts that are different or not available…pending multi-site install or single-site install etc etc. even with your simple instructions, i couldn’t find the proper tag to replace…so i just downloaded a plugin and 1 minute later…fixed.

    • Dawn Youngs says

      I am working in the Organization Theme on WordPress.com. I have managed to set up a static Home Page and a Blog Page which displays my recent posts. I have chosen the summary options for each article in my feed, but when I publish the page I see the full text of each post on my Blog Page. I have set featured images and I have Written Custom Excerpts for my pages and I want a Blog Page displays the excerpts and images with a link to the post page. How in the world do I do this? What is going on with no change between summary and full in the reading section of my settings? Is this an issue with the theme or a general problem in WordPress? I just want a clean simple page that shows a series of excepts for a weekly report, please help!

      By the way, I do not know how to open my files, I cannot even find my file directory, and wonder if it is hidden from me because I am in .com and not hosting the site myself like in .org?

  18. Rahul says

    I have used experts for some of my posts but i found a problem, special signs like,”! are not rendering properly and there’s some utf-8 problem… can you guys conform whether its a WordPress problem or my hosting. Though the problem only causes in my excerpts (summary) but the article with “are opening up fine” and can be read properly. If its a WordPress issue please let us know if there’s any solution to it.

    Thanks,
    RAHUL

  19. Seth says

    I am using the twentythirteen template. None of the files mentioned have “the_content” in them. Also, there is no longer a “loop.php” file. (I only want my archives – tag and category to have the excerpt).

    This is what I see in the archives.php and category.php:

    Changing ‘content’ to ‘excerpt’ also doesn’t seem to do the trick.

      • Imoteda says

        whenI change it in content.php, I can no longer see the full posts on any pages. Clicking on the continue reading link gives me the same excerpt

        • Jenn says

          I’m having the same issue. I successfully changed the_content to the_excerpt. This makes my blogroll successfully show the excerpt instead of the full post. However, when I click into a post, only the excerpt is shown. Is there a way to modify the single.php file to guarantee the entire post content is displayed when viewing a single post? Any advice is really appreciated!

  20. lester says

    finally . . . . FINALLY !!

    i FINALLY found an answer to a problem with wordpress.

    for the love of God and flowers and good food and wine!

    thank you !! thank you !! thank you !!

  21. Daniel Z says

    Thanks! This worked like a gem in the inStyle theme by Elegant Themes. I actually had to edit the code in home.php, but thanks for leading me in the right direction.

  22. Trenton Miller says

    This is great, it’s working for me now. I would like to have the images that I have at the beginning of blog posts that I inserted via HTML, not the Featured Image method. On the blog posts where the image is within the first 55 characters, or whatever you set it to, how can I get it to appear? Is there something extra to add into functions.php?

    • Editorial Staff says

      Automatic excerpts do not show HTML elements. You have two options. Either write a custom excerpt using the excerpts field in your write panel. If you don’t see it, then look at the top right hand corner “Screen Options”. The other option is to use the_content, and utilize the more tag.

      管理者

      • Caroline says

        Ouuch – thanks for your comment. I was searching for hours for this information. Such simple but well hidden if you don’t know how to add individual excerpts. Was looking to change the php files but did not dare for missing experience. All set now, thanks again.

  23. Dr. Erika says

    This is AWESOME. Seriously thank you wpbeginner for all your articles.

    Any idea of how to add pictures to the displayed excerpts?

  24. Bridget says

    OMG dude, thank you so much for this! I literally spent like 45 minutes trying to figure this out with an elegant theme, only to find that your solution took about 12 seconds. Gahh! Oh well, all is well that ends well! Thanks!

    • Deepak says

      Hye Sudip,
      Open any post to edit. On the top of it you will find the screen option. Click on that , then you will see so many options there. Then go to the excerpt option , check on that option. Then below the title and content box, you can see the excerpt box .You can write your excerpt content there.

  25. Jay Madisson says

    Hi,

    Im just wondering, where can I find the (Open your index.php file, archive.php file, and category.php file.)? Sorry for being a noob in HTML :(

    Cheers,

    Jay MAdisson

    • Jerry says

      I’m sorry, are we speaking here of files that reside on my computer? I thought the whole blog was done online. I have no software for WordPress on my computer. I have not downloaded anything. What am I missing? Does one have to know HTML code to blog?

  26. Rich says

    Hello, I’m using the 2010 theme on the blog and it didn’t change to when I replaced content with the word excerpt. Is it something I’m leaving out??

  27. Emma says

    I am using the new twenty twelve theme to base a child theme on and cannot get excerpts to work at all. I looked in all the files you suggest above, but cannot find
    in any of them. Similar to Heather I have imported my blog from blogger too…
    There also doesn’t seem to be a loop.php file
    Help!

      • Emma says

        Thanks for this – I changed entry-content in content.php to

        and it has worked!

        The problem I have now is how to get the excerpt text to wrap around the thumbnail, which I would like to float either right or left.

        Any ideas?

        Thanks

  28. Erin says

    Maybe you can help me here. There is no in any of the files you listed above; index.php, archive.php, or category.php. This is the closest thing that I see (from my index.php file).

    Can I change something in this code or add some new code?

    • Editorial Staff says

      If none of those files exist, that means you are using a child theme. You will have to utilize the hooks in the parent theme framework. We don’t write tutorials specific for theme frameworks.

      管理者

  29. Chris says

    I’m using the twentyeleven theme and “the_content” does not appear in any of the three files mentioned. I’m stumped.

  30. HemantKokcha says

    I am trying to get excerpt but i cant get excerpt by both of your method so tell me correctly how wll i get excerpt in traction theme.

    • wpbeginner says

      @HemantKokcha There is only one method… changing the_content to the_excerpt… The other function is to controlling excerpt length and the excerpt read more. If its not showing in your theme, then perhaps try contacting the theme author. Because this is the only way of doing it.

  31. clwdk says

    Hi there,

    I am using the newest version of the twenty ten theme and am not sure where to change the <?php the_content(); ?> to <?php the_excerpt(); ?>. There is nothing in the index.php as far as I can see. Am I overlooking something? Thanks for any help you can give me.

    CARL

  32. wpbeginner says

    @Ibadullah You have to add this code in your theme’s functions.php file. It should work perfectly fine because this is the way to do it, and we are doing it on our site.

  33. Ibadullah says

    @wpbeginner@Ibadullah I am saying when I add the number in post excerpt – I just see the same number on main page. such as I type 50 in the post excerpt field it show Category name : APPLE and instead of content it show number 50

  34. nescafespk says

    <a href=”http://www.games-masti.com” title=”Play Online Games”>Play Online Games</a>

    This is very nice trick and thanks for help us and thanks for the whole team of the word press team

  35. Carl says

    Great – thanks. Was looking for a simple solution. How do you include a Read more… link after the excerpt also though?

  36. Heather says

    Thank you for the article. I made the changes in all 3 documents and nothing changed. All of the posts on the blog I am working on were imported from Blogger, could that be an issue or perhaps the theme itself? I am stumped!

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。