ThemeShaper Forums » Thematic

[closed]

thematic_category_loop action

(5 posts)
  • Started 4 years ago by sciamannikoo
  • Latest reply from sciamannikoo
  • This topic is resolved
  1. Hello all.

    I'm trying to change how posts are shown in category pages, customizing the thematic_category_loop action with my own function, but it looks that I'm missing something, as nothing happens.

    I've also tried to comment the "thematic_categoryloop();" call on category.php, but I'm still seeing the loop's contents.
    So I did the same on the index.php (just to check) and I still see the loop's contents.

    My code is below, however, I think that, before checking my code, I must understand which action I must work on.

    To be clear, I want to remove meta data, "more" link (with full contents) and thematic_postfooter contents from http://www.disform.org/argomenti/dove-lavora-disform/ (that is supposed to show all posts from "dove-lavora-disform" category).

    This is my code on functions.php:

    function remove_category_loop(){ // its an action not a filter so first remove the thematic action
    	remove_action('thematic_categoryloop', 'thematic_category_loop');
    }
    add_action('init','remove_category_loop');
    
    // The Custom Category Loop
    function disform_category_loop() {
    		while (have_posts()) : the_post(); ?>
    			<div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
    				<?php thematic_postheader_posttitle(); ?>
    				<div class="entry-content">
    <?php thematic_content(); ?>
    
    				</div>
    				<?php thematic_postfooter(); ?>
    			</div><!-- .post -->
    
    		<?php endwhile;
    }
    add_action('thematic_categoryloop', 'disform_category_loop');
    Posted 4 years ago #
  2. Update: it looks like somehow is working.
    I just didn't realize that the loops is called twice (???).
    Check it here: http://www.disform.org/argomenti/risorse/moduli/

    I remove the action with:

    function remove_category_loop(){ // its an action not a filter so first remove the thematic action
    	remove_action('thematic_categoryloop', 'thematic_category_loop');
    }
    add_action('init','remove_category_loop');

    But seems to be ignored...

    Posted 4 years ago #
  3. I really hope someone will help.

    I've tried now to comment the add_action('thematic_categoryloop, 'disform_category_loop'); and I've kept the add_action('init','remove_category_loop'); but I still see the loops done by Thematic.
    It seems like the remove_action('thematic_categoryloop', 'thematic_category_loop'); is completely ignored for some reasons :(

    Posted 4 years ago #
  4. And eventually I came back without any customistation, leaving to the standard Thematic's category.php and realized that it actually render the contents twice.
    Why? I don't know, but apparently, the first loop is executed BEFORE the "nav-above" DIV.

    Posted 4 years ago #
  5. Well, I've eventually found, after one day struggling in the functions.php and content-extensions.php, that, of course, was all my fault! :)
    In functions.php there was a filter to thematic_page_title pointing to my 'disform_category_loop' instead of the right function, messing all the categories pages :)

    I'll set this "soliloquial" post as resolved.

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.