Modifying the_excerpt in function.php

Steak House, food and drink theme, is now available on support forum.
GK User
Wed Oct 29, 2014 8:19 pm
I have been trying to customise the_excerpt, which is called in content.php and have so far been unable to override it by changing the steakhouse_excerpt contained in functions.php.

Any reason why? I have searched through the other files being called and cannot find any other function which hooks into the_excerpt. Have I missed something in a javascript file?

The change I intend to make is to stop it pulling through <img>, <ul> or <ol> tags.
User avatar
Fresh Boarder

GK User
Thu Oct 30, 2014 9:09 am
Hi,

You have to know that all HTML tags are stripped before returning the text in excerpt.
This article should be helpful:
http://wordpress.stackexchange.com/ques ... in-excerpt

You can also easily change your the_excerpt code form content.php with i.e. this code:
Code: Select all
<?php echo substr(get_the_content(), 0, 300); ?>

which will display first 300 chars of the post content (with html tags).
User avatar
Moderator


cron