ThemeShaper Forums » Thematic

[closed]

How to customize the loop for index page, single post and archive pages

(5 posts)
  • Started 4 years ago by gattonero
  • Latest reply from gattonero
  • This topic is resolved

Tags:

  1. First of all I want to thank all of you for you're work :)

    I'm kinda new to Thematic... I've created my personalized themes for Wordpress in the past but I wanted to start using frameworks.

    Now. I needed to heavily customize the loop of Thematic, and I've understood how to eliminate the standard loop from the them. But I've had quite a lot of difficulties creating my own.

    That's the code I've used (it's not complete, I have to add all the meta fields):

    function remove_thematic_index_loop(){
    	remove_action('thematic_indexloop','thematic_index_loop');
    	}
    add_action('init', 'remove_thematic_index_loop');
    
    function child_index_loop(){
    	while ( have_posts() ) : the_post() ?>
    			<div id="post-<?php the_ID() ?>" class="<?php thematic_post_class() ?> <?php if ( has_post_thumbnail() ) { echo "conthumb"; } ?>">
        			<div class="testatapost"><?php the_post_thumbnail(); ?>
        			<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><div class="entry-title">
        				<h2><?php the_title(); ?></h2>
        				<span class="entry-excerpt"><?php the_excerpt(); ?></span>
        			</div></a>
        			</div>
    				<div class="entry-content">
    <div class="addtoany_share_save_container"><?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?></div>
    					<?php thematic_content(); ?>
    				</div>
    				<?php thematic_postfooter(); ?>
    			<br style="clear: both;" />
    			</div><!-- .post -->
    			<?php
    		endwhile;
    }
    add_action('thematic_indexloop', 'child_index_loop');

    (You can see the result in http://test.fermentigattici.net)

    The problem is: do I have to replicate this code for single and search and archive pages?
    Or can I use child_index_loop for all of these?

    More in general: I haven't found a clear documentation about the functions used for generating the loops.
    Are there any?

    (Sorry for my English: italian schools are not that good teaching it ;) )

    Posted 4 years ago #
  2. The method seems right. Did you run into any problems?

    (Don't be sorry, your English is good. However, you did use "you're" instead of "your", which reminded me of the following post by paddy: http://iampaddy.com/spell/.) Haha (:

    Artur Kim

    Posted 4 years ago #
  3. My God :D
    (There is a similar post for italian mis-spellings... Funny ;) )

    Did I have any problem... Uhm: yes.
    Let's say: there's nowhere a list of the function/hooks calling the loops. One of that is thematic_index_loop, and I found it.
    I tried with thematic_single_loop and it seemed to work, but when I inserted "child_index_loop" instead of thematic_single_loop, nothing worked.
    I thought that thematic_single_loop must have a different structure of thematic_index_loop, but... how to find it? :)
    (Same with archive loop)

    Posted 4 years ago #
  4. Oh, I understand what you mean now. The Thematic Guide doesn't seem to be mentioning these hooks.

    Here's a list of hooks that deal with thematic_content():

    thematic_archive_loop()
    thematic_author_loop()
    thematic_category_loop()
    thematic_index_loop()
    thematic_single_post()
    thematic_search_loop()
    thematic_tag_loop()

    You can actually take a look at these functions in thematic/library/extensions/content-extensions.

    Artur Kim

    Posted 4 years ago #
  5. Thanks, that's very helpful.
    I'll take a look as soon as possible.

    I think that would be nice, sooner or later, to add a list of every loop-hook used in thematic, and what there is inside any of it.
    But it seems to me a huuuuge work ;)

    (Just to make a general discussion: but, if I change the loop and the theme so much, wouldn't be easier to start from scratch? Which are the pros using a framework, in these cases?)

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.