I had to introduce Manual Excerpts in order to use some Mail Chimp functionality
What plugin are you using for this? I’m wondering if they have a filter you could possibly hook to in order to get this.
]]>My understanding is that the function wp_trim_excerpt() (found in the formatting.php file according to developer.www.ads-software.com) only creates the auto excerpt if there is no manual excerpt. I am now wondering if I can modify this function, so that it always generates an auto excerpt.
I am comfortable changing the code that was made from the contractor. But I get the vibe that this is WordPress standard functionality and concern that changing it will affect other areas of the site. Hence, why I preferred to ask about it before touching anything in the code.
]]>It’s OK to change template code (any theme code actually) of custom developed themes. It’s not OK to change core WP code, and ill advised to change published theme templates or code. You could replace the function calls on a template with functions of your own design. Another alternative is to make use of filters that go with each WP function: “the_excerpt” and “the_content”. Your filter callback is passed the normal output. What your callback returns is what is actually output. So you could add a filter to “the_excerpt” that ignores the passed value and auto generates the excerpt from $post->post_content using wp_trim_excerpt() or wp_trim_words().
The related code to declare callbacks and add filters can go in functions.php of a custom theme, functions.php of a child theme whose parent is a published theme, or a custom site specific plugin. In fact, all customizations besides altered theme templates should be done through filter and action callbacks. On occasions where required, pluggable functions can be declared in the same places. While you could use all of the above code locations on one site, you should pick one and manage it all through that one location.
You have lots of viable options. Because calls to the_content() and the_excerpt() can appear on several different templates, I personally would use the filter approach, declaring the callbacks and adding the filters on functions.php of the custom theme. One callback added to two filters can cover all possible situations on all of the templates in a single code location.
]]>