ThemeShaper Forums » Thematic

Why isn't this filter function working? Changing previous post link text...

(5 posts)
  • Started 4 years ago by awarner20
  • Latest reply from awarner20
  • This topic is not resolved
  1. Hi everyone,

    I am trying to remove the default "Older Posts" text and replace it with "More Products" on my category archive pages. I'm using this filter:

    // Remove default thematic_nav_below
    function remove_thematic_nav_below() {
        remove_action('thematic_nav_below','thematic_navigation_below',2);
    }
    add_action('init','remove_thematic_nav_below');
    
    function childtheme_thematic_nav_below() {
    		if (is_single()) { ?>
    
    			<div id="nav-below" class="navigation">
    				<div class="nav-previous"><?php thematic_previous_post_link() ?></div>
    				<div class="nav-next"><?php thematic_next_post_link() ?></div>
    			</div>
    
    <?php
    		} else { ?>
    
    			<div id="nav-below" class="navigation">
                    <?php if(function_exists('wp_pagenavi')) { ?>
                    <?php wp_pagenavi(); ?>
                    <?php } else { ?>
    				<div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&laquo;</span> More products', 'thematic')) ?></div>
    				<div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">&raquo;</span>', 'thematic')) ?></div>
    				<?php } ?>
    			</div>	
    
    <?php
    		}
    }
    add_action('thematic_navigation_below', 'childtheme_thematic_nav_below', 2);

    This is adding "More Products" the bottom of my category archive page, but the default "Older posts" is still there also. Am I not removing it correctly?

    Any advice would be greatly appreciated.

    Posted 4 years ago #
  2. amygail
    Member

    Shooting in the dark here....
    Do you need to add a conditional for the category pages?

    Posted 4 years ago #
  3. Hi Amy,

    I don't think so. This successfully adds the "More products" link to the bottom of the category archive page. The issue is that it is being inserted directly underneath the original "Older posts" link. I just can't get the original "Older posts" removed. That's why I'm thinking I may have something wrong with my remove function above...but I don't know what it could be?

    Posted 4 years ago #
  4. You haven't really removed the old action :)

    Try:

    remove_action('thematic_navigation_below', 'thematic_nav_below', 2);

    Chris

    Posted 4 years ago #
  5. Oh man...do I get any points for being close? :)

    Thanks Chris!

    Posted 4 years ago #

RSS feed for this topic

Reply

You must log in to post.