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

Jak wyświetlać zajawki wpisów w motywach WordPressa

Uwaga redakcyjna: Otrzymujemy prowizję z linków partnerskich na WPBeginner. Prowizje nie mają wpływu na opinie i oceny naszych redaktorów. Dowiedz się więcej o Proces redakcyjny.

Chcesz dowiedzieć się, jak wyświetlać zajawki wpisów w twoim motywie WordPress?

Wyświetlając na blogu zajawki wpisów zamiast pełnych artykułów, możesz pomóc odwiedzającym szybko znaleźć interesujące treści i skrócić czas wczytywania twojej witryny.

W tym artykule pokażemy, jak łatwo dodać zajawki wpisów do twojego motywu WordPress.

How to display post excerpts in WordPress themes

Dlaczego warto wyświetlać zajawki wpisów w WordPressie?

Domyślnie WordPress wyświetla pełne wpisy na stronie głównej, stronie bloga i stronach archiwum w twojej witrynie internetowej. Nie jest to jednak najlepsze rozwiązanie dla użytkowników, którzy chcą szybko przejrzeć różne wpisy i znaleźć ten, który chcą przeczytać w pierwszej kolejności.

Może to również oznaczać dużo przewijania, co jest ogromnym problemem dla użytkowników smartfonów i tabletów.

Gdy publikujesz więcej wpisów, WordPress może również podzielić twój blog na wiele stron za pomocą paginacji. Gdy twoje starsze wpisy zostaną przeniesione na inne strony, często będą one miały znacznie mniej zobaczów i będą mniej angażujące.

Z tego powodu wielu właścicieli blogów wyświetla zamiast tego zajawki wpisów na stronach archiwum i indeksu bloga. Ponieważ wczytywana jest tylko część każdego artykułu, może to zwiększyć szybkość i wydajność twojego WordPressa.

An example of post excerpts in a WordPress theme

WordPress ma wbudowaną obsługę zajawek wpisów, ale nie każdy motyw korzysta z tej funkcji.

To powiedziawszy, pokażmy, jak wyświetlać zajawki wpisów w dowolnym motywie WordPress.

Jak sprawdzić, czy twój motyw WordPress obsługuje zajawki wpisów?

Większość popularnych motywów WordPress posiada ustawienia, które pozwalają na wyświetlanie zajawek postów zamiast pełnych wpisów.

Aby sprawdzić, czy twój motyw obsługuje zajawki wpisów, przejdź na stronę Wygląd ” Dostosuj w kokpicie WordPress.

Lokalizacja tych ustawień będzie się różnić w zależności od twojego motywu WordPress, ale musisz szukać ustawień oznaczonych jako „Blog”.

Adding post excerpts to a WordPress theme using the Customizer

Na przykład, jeśli korzystasz z motywu Astra WordPress, musisz wybrać „Blog”, a następnie kliknąć „Blog/Archiwum”.

Następnie przewiń w dół do sekcji „Elementy wpisu” i rozwiń kartę „Zajawka”. Gdy to zrobisz, wybierz opcję „Zajawka”.

Adding post excerpts to your WordPress website

Jeśli twój motyw ma opcję „Ustawienia motywu” lub „Ustawienia ogólne wpisów”, możesz również włączyć zajawki wpisów w tych sekcjach.

Gdy to zrobisz, po prostu kliknij przycisk „Opublikuj”. Teraz, jeśli przejdziesz na bloga, archiwum lub stronę główną, powinieneś zobaczyć listę zajawek blogów, a nie pełnych wpisów.

Jeśli twój motyw nie ma wbudowanej obsługi zajawek wpisów, będziesz musiał ją dodać. Wystarczy skorzystać z poniższych odnośników, aby przejść do wybranej metody:

Metoda 1: Dodawanie zajawek wpisów do WordPressa za pomocą kodu (łatwe)

Jeśli twój motyw WordPress domyślnie nie obsługuje zajawek wpisów, zawsze możesz dodać tę funkcję ręcznie.

Możesz edytować pliki motywu WordPress bezpośrednio, ale zalecamy utworzenie motywu potomnego. W ten sposób podczas aktualizacji twojego motywu WordPress nie utracisz wprowadzonych zmian.

Aby uzyskać więcej informacji, zapoznaj się z naszym przewodnikiem dla początkujących na temat tworzenia motywu potomnego WordPress.

Po wykonaniu tej czynności należy znaleźć szablon kontrolujący każdą stronę, na której mają być wyświetlane wpisy zajawek. W przypadku większości motywów będą to home.php, treść.php, kategoria.php i archiwum.php.

Aby uzyskać pomoc w znalezieniu odpowiedniego pliku, zapoznaj się z naszym przewodnikiem dla początkujących po hierarchii szablonów WordPress.

Gdy to zrobisz, po prostu znajdź następujący kod w każdym pliku:

<?php the_content(); ?>

Następnie zastąp ten kod tagiem_excerpt:

<?php the_excerpt(); ?>

Po wykonaniu tej czynności zapisz plik, a następnie sprawdź twoją witrynę internetową. Powinieneś teraz zobaczyć zajawki wpisów w miejscu, w którym wcześniej znajdował się pełny artykuł.

Zmiana domyślnej długości zajawki WordPressa

Domyślnie WordPress wyświetli pierwsze 55 słów każdego wpisu, a następnie doda wielokropek (…), aby pokazać, że jest więcej treści.

Możesz to zmienić, aby wyświetlać więcej lub mniej słów, dodając kod do twojej witryny internetowej WordPress. Chociaż możliwa jest bezpośrednia edycja plików motywu, może to być skomplikowane.

Prosty błąd może również spowodować wiele typowych błędów WordPressa, a nawet całkowicie zepsuć twoją witrynę.

Z tego powodu zalecamy korzystanie z WPCode. Ułatwia on dodawanie fragmentów kodu w WordPressie bez konieczności edytowania plików twojego motywu. W ten sposób możesz zaktualizować lub zmienić swój motyw bez utraty własnego kodu.

Najpierw należy zainstalować i włączyć darmową wtyczkę WPCode. Więcej informacji można znaleźć w naszym przewodniku dla początkujących na temat instalacji wtyczki WordPress.

Po włączaniu, przejdź na stronę Code Snippets ” + Add Snippet z kokpitu WordPress i kliknij przycisk „Use Snippet” pod opcją „Add Your Custom Code (New Snippet)”.

How to show post excerpts using code

Na następnym ekranie wpisz tytuł fragmentu kodu. To jest tylko dla twojego odniesienia, więc możesz użyć czegokolwiek chcesz.

Następnie otwórz menu rozwijane „Rodzaj kodu” i wybierz „Fragment kodu PHP”.

Customizing your post excerpts using code

Po wykonaniu tej czynności wystarczy wkleić poniższy tekst do edytora kodu:

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');

Ten kod zmienia długość zajawki wpisu na 100 znaków. Możesz zmienić „100” na dowolną liczbę.

Po wklejeniu kodu przełącz przełącznik z „Nieaktywny” na „Aktywny” w prawym górnym rogu, a następnie kliknij przycisk „Zapisz fragment kodu”.

Save and activate code snippet WPCode

Aby uzyskać więcej wskazówek na temat tego, jak dopracować twoje wpisy, zapoznaj się z naszym przewodnikiem na temat dostosowywania zajawek WordPress bez użycia kodu.

Metoda 2: Dodawanie zajawek wpisów przy użyciu pełnego edytora witryny (tylko motywy blokowe)

Jeśli korzystasz z jednego z nowszych blokowych motywów WordPress, możesz dodawać zajawki wpisów za pomocą pełnego edytora witryny.

Aby rozpocząć, przejdź do Wygląd ” Edytor w kokpicie WordPress.

Using the full-size editor (FSE)

Domyślnie pełny edytor witryny wyświetla szablon główny twojego motywu, ale możesz dodać zajawkę do dowolnego szablonu.

W menu po lewej stronie kliknij „Szablony”.

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

Zobaczysz teraz listę wszystkich szablonów, które składają się na twój motyw WordPress. W zależności od twojego motywu, możesz chcieć dodać zajawki do archiwum, indeksu, wyszukiwania lub podobnego szablonu.

Po prostu znajdź szablon, który chcesz edytować i kliknij go.

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

WordPress wyświetli teraz podgląd tego szablonu.

Aby przejść dalej i edytować szablon, kliknij małą ikonkę ołówka.

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

Teraz kliknij ikonkę „+”.

W wyświetlonym panelu wyszukiwania wpisz „Zajawka wpisu”.

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

Gdy pojawi się odpowiedni blok, przeciągnij go i upuść w twoim układzie.

Możesz powtórzyć ten proces, aby dodać wiele zajawek wpisów do szablonu.

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

Aby dostosować wygląd zajawki, wystarczy kliknąć, aby wybrać blok Zajawka wpisu.

W menu po prawej stronie można zacząć od wybrania, czy odnośnik „Dowiedz się więcej” pojawi się w tej samej linii co zajawka, korzystając z przełącznika „Pokaż odnośnik w nowej linii”.

Adding a read more button to a blog archive page

Następnie wybierz kartę „Style”. Tutaj możesz zmienić kolor tekstu, dodać kolor tła, zmienić wielkość liter i wiele więcej.

Podczas wprowadzania zmian podgląd na żywo będzie aktualizowany automatycznie, dzięki czemu można wypróbować różne ustawienia, aby zobaczyć, co wygląda najlepiej.

How to customize a WordPress post excerpt

Gdy będziesz zadowolony z konfiguracji zajawki wpisu, kliknij przycisk „Zapisz”, aby wprowadzić zmiany.

Chcesz wyświetlać zajawki postów na większej liczbie stron i wpisów? Powtórz powyższe kroki, ale tym razem wybierz nowy szablon z menu po lewej stronie.

Metoda 3: Dodawanie zajawek wpisów do WordPressa za pomocą kreatora motywów (zaawansowane)

Jeśli chcesz mieć pełną kontrolę nad wyglądem archiwum, strony bloga, strony głównej i reszty witryny, możesz utworzyć własny motyw.

Umożliwia to projektowanie własnych stron i wyświetlanie zajawek w dowolnym miejscu twojej witryny internetowej.

SeedProd to najlepszy kreator motywów WordPress, który umożliwia łatwe tworzenie własnych motywów WordPress bez pisania jakiegokolwiek kodu. Posiada również gotowy wpis Posts, który można przeciągnąć i upuścić na dowolnej stronie.

Uwaga: Istnieje darmowa wtyczka SeedProd, która umożliwia tworzenie pięknych stron w najbliższym czasie i w trybie konserwacji, bez względu na twój budżet. Będziesz jednak potrzebować planu SeedProd Pro lub Elite, aby odblokować kreator motywów.

Najpierw należy zainstalować i włączyć wtyczkę SeedProd. Aby uzyskać więcej informacji, zobacz nasz przewodnik krok po kroku, jak zainstalować wtyczkę WordPress.

Po włączaniu, przejdź do strony SeedProd ” Ustawienia i wpisz klucz licencyjny wtyczki. Informacje te można znaleźć na Twoim koncie w witrynie internetowej SeedProd.

Adding a SeedProd license key to WordPress

Po wpiszeniu klucza licencyjnego jesteś gotowy do utworzenia własnego motywu WordPress za pomocą kreatora motywów SeedProd.

Najpierw należy przejść do strony SeedProd ” Kreator motywów.

The SeedProd theme builder

W tym miejscu można użyć jednego z gotowych zestawów i szablonów witryn SeedProd jako punktu wyjścia lub ręcznie utworzyć szablon od podstaw.

Zalecamy rozpoczęcie od istniejącego motywu, ponieważ automatycznie tworzy on wszystkie niezbędne pliki szablonów i zapewnia przewagę.

Mając to na uwadze, kliknij przycisk „Zestawy szablonów motywów”.

Creating a custom WordPress theme using SeedProd

Możesz teraz wybrać dowolny z dostępnych szablonów.

Wszystkie te motywy są w pełni konfigurowalne, dzięki czemu można je idealnie dostosować do twojego bloga lub witryny internetowej WordPress.

Choosing a theme template for your WordPress website or blog

Po wybraniu motywu SeedProd automatycznie utworzy wszystkie potrzebne szablony motywów.

Możesz myśleć o tym jako o wersji roboczej twojego własnego motywu WordPress.

Customizing the blog, archive, and search pages using SeedProd

Każdy szablon można teraz dostosować do własnych potrzeb za pomocą edytora przeciągnij i upuść SeedProd.

Ponieważ chcemy dodać zajawki wpisów do naszej witryny internetowej, najedź kursorem myszy na szablon„Blog Index, Archives, Search” i kliknij odnośnik „Edit Design”, gdy się pojawi.

How to add post excerpts to your WordPress theme with SeedProd

Spowoduje to wczytywanie kreatora przeciągnij i upuść SeedProd.

Po prawej stronie zobaczysz podgląd szablonu. Domyślnie szablon strony bloga wyświetla nagłówek, archiwum, tytuł i wszystkie twoje wpisy.

The SeedProd drag and drop theme editor and page builder

Po lewej stronie znajduje się menu z różnymi blokami, których można użyć.

Możesz utworzyć nowe bloki, przeciągając je na stronę, a następnie zmienić ich kolejność, przeciągając je myszką w górę i w dół.

Możesz dostosować dowolny blok, klikając go, a następnie korzystając z ustawień w menu po lewej stronie. Po wprowadzeniu zmian podgląd SeedProd zostanie automatycznie zaktualizowany, aby pokazać te zmiany w działaniu.

How to customize any block in a WordPress theme

Ponieważ chcemy dostosować zajawki postów, wystarczy kliknąć, aby wybrać blok „Wpisy” w podglądzie na żywo.

Następnie wybierz treść, którą chcesz wyświetlić w tym bloku, korzystając z ustawień w menu po lewej stronie.

Można na przykład zmienić układ kolumn, wyświetlić paginację, pokazać obrazek wyróżniający i zmienić tagi tytułowe.

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

Aby wyświetlić fragment wpisu, wystarczy kliknąć przełącznik „Pokaż zajawkę”, aby zmienił kolor na pomarańczowy.

Gdy już to zrobisz, możesz zmienić liczbę znaków wyświetlanych przez SeedProd w zajawce, wpisując nowy rodzaj w polu „Długość zajawki”.

Adding blog excerpts to a WordPress theme

SeedProd może również dodać odnośnik „Dowiedz się więcej” do każdej zajawki, co zachęci czytelników do otwarcia pełnego artykułu.

Możesz dodać lub usuwać ten odnośnik za pomocą przełącznika „Pokaż Dowiedz się więcej”.

Adding a 'Read More' button to your post excerpts

Możesz również zastąpić tekst „Dowiedz się więcej” twoim własnym rodzajem wiadomości, wpisując go w polu „Czytaj więcej tekstu”.

Gdy będziesz zadowolony z ustawień zajawki wpisu, kliknij przycisk „Zapisz” w prawym górnym rogu twojego ekranu.

Customizing the 'Read More' link in a post excerpt

Możesz teraz dostosować inne szablony SeedProd, przechodząc do SeedProd ” Theme Builder i postępując zgodnie z tym samym procesem opisanym powyżej.

Aby wyświetlać odwiedzającym zajawki wpisów, należy najpierw włączyć twój motyw SeedProd. Aby to zrobić, przejdź do SeedProd ” Theme Builder , a następnie kliknij przełącznik „Enable SeedProd Theme”, aby wyświetlić „Yes”.

How to enable a custom WordPress theme using SeedProd

Teraz, jeśli przejdziesz na którąkolwiek ze stron twojego bloga, zobaczysz zajawki wpisów na żywo.

Bonus: Pokaż zajawki treści zabezpieczonych hasłem

Jeśli posiadasz witrynę członkowską, możesz mieć pewne treści, które są niedostępne dla ogółu odbiorców. Jednak nadal dobrym pomysłem jest pokazanie zajawki twojej treści zabezpieczonej hasłem.

Może to zaintrygować użytkowników i zachęcić ich do zakupu subskrypcji, aby uzyskać dostęp do ekskluzywnych treści w Twojej witrynie internetowej.

Można to łatwo zrobić za pomocą Restrict Content Pro, która jest popularną wtyczką do zabezpieczania treści. Po włączaniu wystarczy otworzyć twój wpis w edytorze bloków WordPress, gdzie możesz dodać do niego zajawkę z panelu bloków.

Następnie można skonfigurować jego ograniczenia z menu rozwijanego.

Add an excerpt for the restricted post

Na koniec opublikuj wpis, a następnie przejdź na swoją witrynę WordPress.

W tym przypadku użytkownicy będą mogli zobaczyć zajawkę i tytuł ograniczonej treści, tak jak w przypadku każdego innego wpisu. Sama treść będzie jednak ukryta przed odbiorcami.

Protected content excerpt preview

Aby uzyskać szczegółowe instrukcje, możesz również zapoznać się z naszym poradnikiem na temat tego, jak wyświetlić zajawkę wpisu zabezpieczonego hasłem w WordPressie.

Mamy nadzieję, że ten artykuł pomógł ci dowiedzieć się, jak wyświetlać zajawki wpisów w motywach WordPress. Zachęcamy również do zapoznania się z naszym przewodnikiem na temat zarabiania pieniędzy na blogu za pomocą WordPress a, a także z naszymi typami najlepszych wtyczek i narzędzi SEO do WordPressa.

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.

Ujawnienie: Nasze treści są wspierane przez czytelników. Oznacza to, że jeśli klikniesz na niektóre z naszych linków, możemy otrzymać prowizję. Zobacz jak WPBeginner jest finansowany, dlaczego to ma znaczenie i jak możesz nas wspierać. Oto nasz proces redakcyjny.

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.

Najlepszy zestaw narzędzi WordPress

Uzyskaj BEZPŁATNY dostęp do naszego zestawu narzędzi - zbiór produktów i zasobów związanych z WordPressem, które każdy profesjonalista powinien mieć!

Reader Interactions

94 komentarzeZostaw odpowiedź

  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

      Administrator

  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?

    • 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

  9. 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.

  10. 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

  11. 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

  12. 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.

  13. 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”)?

  14. 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 ?

  15. 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?

  16. 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?

  17. 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

  18. 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!

  19. 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 !!

  20. 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.

  21. 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.

      Administrator

      • 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.

  22. 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?

  23. 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.

  24. 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?

  25. 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??

  26. 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

  27. 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.

      Administrator

  28. Chris says

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

  29. 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.

  30. 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

  31. 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.

  32. 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

  33. 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

  34. Carl says

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

  35. 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!

Zostaw odpowiedź

Dziękujemy za pozostawienie komentarza. Pamiętaj, że wszystkie komentarze są moderowane zgodnie z naszymi polityka komentarzy, a Twój adres e-mail NIE zostanie opublikowany. NIE używaj słów kluczowych w polu nazwy. Przeprowadźmy osobistą i konstruktywną rozmowę.