Topic: Wordpress Blog Tutorial - Issue with the_excerpt Template Tag
taurusteame free asked 5 years ago
I have been following the wordpress blog tutorial by Dawid Adach. But, I have run into a curious problem that I am unable to resolve. On the blog posts page, all the template tags work without a problem, except for "the_excerpt" template tag. It just refuses to output the wordpress default excerpt. According to the tutorial, the code is given below. I have searched google and have checked the wordpress codex dox, but just cannot figure out why. All other fields are displaying correctly. Any assistance would be a big source of comfort.
================================
by " class="font-weight-bold dark-grey-text">,
<p class="grey-text"><?php the_excerpt(); ?></p>
<a href="<?php echo get_permalink() ?>" class="btn btn-info btn-rounded btn-md">Read more</a>
</div>
<!--Grid column-->
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Free
- Premium support: No
- Technology: Other
- MDB Version: -
- Device: Laptop
- Browser: Chrome
- OS: Windows, xampp
- Provided sample code: No
- Provided link: No
Arkadiusz Cacko staff commented 5 years ago
Did you try use
get_the_excerpt()
? Also you can take post content fromthe_content()
function and usesubstr
to get this excerptsubstr($post->the_content, 0, 150)
.taurusteame free commented 5 years ago
Hi Arkadiusz ... Thanks for your help. I've just discovered that all is fine with the original the_excerpt() snippet. It works correctly with my online website. The problem seems to be that the wordpress export/import tool is not fully updating my offline xampp version, on which I am working. On trying a few more times, I keep getting the "Failed to update ..." message. But thanks, once again for your attention. At least I now know that the original code works. I can work on the rest of my page.
Arkadiusz Cacko staff commented 5 years ago
No problem, I'm glad that the_excerpt() function working. If you will have any other problems with code, please let me know.
taurusteame free commented 5 years ago
Thanks, Arkadiusz. Your kindness is much appreciated. Have a lovely day.