Relatively new to Thematic and child-themes, so please excuse me if all of this sounds silly.
I would like to get the_excerpt_reloaded plugin to handle my excerpts, so that they don't get stripped of link and image tags. This should happen in category, archives and search pages. Since there is no filter hook for the thematic_content section in charge of this, the only way I could accomplish that was to get rid of the default actions for the loops, like this:
function mytheme_overrides() {
remove_action('thematic_categoryloop', 'thematic_category_loop');
remove_action('thematic_archiveloop', 'thematic_archive_loop');
remove_action('thematic_searchloop', 'thematic_search_loop');
}
add_action('init', 'mytheme_overrides');
Then rewrite the loops, like this:
function mytheme_category_loop() {
while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
<?php thematic_postheader(); ?>
<div class="entry-content">
<?php mytheme_content(); ?>
</div>
<?php thematic_postfooter(); ?>
</div><!-- .post -->
<?php endwhile;
}
add_action('thematic_categoryloop', 'mytheme_category_loop');
All the above is needed only in order to call mytheme_content instead of thematic_content (it's the only change in the code). This function is repeated two more times for the archives and search loops. Then, I need to change one line in thematic_content for it to become mytheme_content, like this:
function mytheme_content() {
if (is_home() || is_front_page()) {
$content = 'full';
} elseif (is_single()) {
$content = 'full';
} elseif (is_tag()) {
$content = 'excerpt';
} elseif (is_search()) {
$content = 'excerpt';
} elseif (is_category()) {
$content = 'excerpt';
} elseif (is_author()) {
$content = 'excerpt';
} elseif (is_archive()) {
$content = 'excerpt';
}
$content = apply_filters('thematic_content', $content);
if ( strtolower($content) == 'full' ) {
$post = get_the_content(more_text());
$post = apply_filters('the_content', $post);
$post = str_replace(']]>', ']]>', $post);
} elseif ( strtolower($content) == 'excerpt') {
$post = get_the_excerpt_reloaded(100, '<img><a><h2><h3><h4><strong>', 'excerpt', TRUE, '(Read more)', FALSE, 1, TRUE, 'span', 'more', TRUE);
} elseif ( strtolower($content) == 'none') {
} else {
$post = get_the_content(more_text());
$post = apply_filters('the_content', $post);
$post = str_replace(']]>', ']]>', $post);
}
echo apply_filters('thematic_post', $post);
}
</strong></a>
Seems like an awful lot of work, and is a case where modifying the theme directly would have resulted in one line of code being changed. Is there a shorter way (currently) of doing all this in a Thematic child theme?
BTW, I know I could write one function for all three but I want to keep future customizations of each of the three loops possible.
Thanks.