ThemeShaper Forums » Thematic

how do i replace thematic_content()

(6 posts)
  • Started 9 years ago by tengopreguntas
  • Latest reply from Chris
  • This topic is not resolved
  1. tengopreguntas
    Member

    I have been struggling with this for hours, and cannot come up with the right way to do it.
    how do i replace the thematic_content() with the ct_content() [ct for child theme) function of my own,
    i tried removing the action, and adding the new one.
    with filters,
    nothing came up. it seems like there is no easy way to do this.
    can anybody help
    thanks in advance for your help

    Posted 9 years ago #
  2. Could you please explain what you're trying to do with your ct_content() ?!

    Chris

    Posted 9 years ago #
  3. tengopreguntas
    Member

    i want to add many things, that i will have to create a new function. but for explaining purposes, it could be anything. a string replacement if you want.
    but it has to be in a new function.

    i was looking around and i can tell its badly done because the thematic_content() prints the results when it should be returning it, which makes it difficult to work upon that. am i wrong?

    if you have an example of how to replace it, it will save me from another big headace
    thanks

    Posted 9 years ago #
  4. If you really looked around you should have got the intention of the filter thematic_content(), and that you can filter the content either using the standard filter the_content() or thematic_post().

    Chris

    Posted 9 years ago #
  5. tengopreguntas
    Member

    thanks for replying.
    here's the code to exemplify my situation:

    comment out one by one the add_filter lines.

    code updated after 3 mintues of posting it

    <?php
    //functions.php
    function child_content($content) {
    	$content = "CHILD_".md5($content);
    	return $content;
    }
    function alt_child_content($content) {
    	$content = apply_filters('alt_child_content', $content);
    	$content = "ALT_CHILD_".md5($content);
    	return $content;
    }
    //add_filter('the_content', 'child_content'); //it works
    //add_filter('the_content', 'alt_child_content'); //it works
    //add_filter('thematic_content', 'child_content'); //it DOESN'T work
    //add_filter('thematic_content', 'alt_child_content'); //it DOESN'T work
    //add_filter('thematic_post', 'child_content'); //it works
    //add_filter('thematic_post', 'alt_child_content'); //it works
    ?>

    for some reason filters don't work for thematic_content
    any clues?
    thanks

    PS: this is done in a clean install of thematic, for the thematicsamplechildtheme

    Posted 9 years ago #
  6. thematic_content() was never created for this. Take a look here:

    http://forums.themeshaper.com/topic/adding-a-loop#post-3684

    Chris

    Posted 9 years ago #

RSS feed for this topic

Reply

You must log in to post.