Moderator
t-p
(@t-p)
– Unfortunately, your currently used “MyNewTheme” theme is not in the wordpress.org/themes/ directory:
https://wordpress.org/themes/search/MyNewTheme/
– For pro or commercial product support please contact the author directly on their site.
– As the author is aware, commercial products are not supported in these forums. As you are their customer I am sure they will have no problem supporting you there. It also allows the developers to be aware of issues with their code.
not able to show the whole content of the post despite I click on the Post name
what file have you edited?
is it possible that this file is called from the index template and the single post template?
Thread Starter
happik
(@happik)
Hi all,
@alchymyth: I have called all posts in the loop in the index file. I didn’t create a post template by myself yet. I have added another file archive.php with the same content as index. Could this be the problem?
@t-p: I am working on my own theme, that’s why I write to the developing group. There is nothing special except the loop and added other infos. I hope somebody have experience to help me.
just use echo get_the_excerpt() instead of the_excerpt().
Hope it will solve the issue
Hi Happik,
You need to create new template for single post(single.php) and paste all code form index file. And just replace the_excerpt() with get_content().
Dobrý den. Ketan Ambaliya offers good advice. For the sake of discussion, you do not need to create a single.php template, though it’s a good idea. As you’ve seen, if no single.php template exists, WP will use index.php. You could place a conditional on index.php where the use of content or excerpt depends on the value returned by is_single(). Then both situations are covered by one template.
Having the single.php template is generally a good idea. It allows you to lay out the page differently than index.php, using different classes, template parts, etc. While you could continue to use is_single() to achieve the same end on index.php, its repeated use starts to become silly at some point.
Another benefit of a separate single.php is a user may wish to further customize your theme by creating a child theme. Users with limited PHP skills will have a better time modifying a straight forward template instead of a convoluted template with many conditionals.
Thread Starter
happik
(@happik)
Hi all.
Thank you all for your contribution to this thread. You all have helped me to find the solution.
It is not a good idea to write the get_excerpt() to the file index.php without any rules and without the file single.php.
If there is no single.php (and I do not have it) then there isn’t the way to show the whole content.
It would work with the combination of single.php with get_content() inside, but the best way for me is to use is_single() in index.php.
It’s working now! Thank you.
-
This reply was modified 8 years, 11 months ago by
happik.