ThemeShaper Forums » Thematic


How to remove the index_loop and replace it with my own?

(2 posts)
  • Started 10 years ago by adred
  • Latest reply from McSalty
  • This topic is not resolved


  1. adred

    I have this code:

    function remove_index_loop() {
    remove_action('thematic_indexloop', 'thematic_index_loop');
    add_action('init', 'remove_index_loop');

    function show_single_post(){
    if(is_home() & !is_paged()){
    $i=0; // Initialize to Zero;
    if (have_posts()) :
    while (have_posts()) : the_post();
    if ($i==0) {$recentpostid = $post->ID; $i=$i+1;}
    //get only the latest post
    $posts = query_posts( 'p='.$recentpostid."'");
    add_action('thematic_indexloop', 'show_single_post');

    but it doesn't work?

    Posted 10 years ago #
  2. You don't need to mess with add_action and remove_action. Simply create the following function in your childtheme's functions.php, and it automatically overrides the index loop:

    function childtheme_override_index_loop() {
            // Whatever you want to do
    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.