• I am trying to change “older/newer posts” wording on the search results page. I have tried to do this by placing the following in functions.php in my theme folder:

    /*...............
    Changing "older/newer posts" wording for search results page
    ...............*/
    add_filter('twentytwelve_content_nav', 'mychild_theme_content_nav');
    if (is_search()) {
    function mychild_theme_content_nav( $html_id ) {
    	global $wp_query;
    	$html_id = esc_attr( $html_id );
    	if ( $wp_query->max_num_pages > 1 ) : ?>
    		<nav id="<?php echo $html_id; ?>" class="navigation" role="navigation">
    			<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
    			<div class="nav-previous alignleft"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> less relevance to the search', 'twentytwelve' ) ); ?></div>
    			<div class="nav-next alignright"><?php previous_posts_link( __( 'more relevance to the search <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
    		</nav><!-- #<?php echo $html_id; ?> .navigation -->
    	<?php endif;
    						}
    }

    Alas, the “older/newer post” links at the bottom of the search results page persists. Any ideas what I’ve done wrong with my coding?

    Thank you.

    -E Morris, etherwork [dot] net [slash] blog <<purposely unlinked in attempt to keep spammers at bay (there’s a really good reason that I have iThemes Security plugin who helped enormously to rid me of bruteforce attacks)

Viewing 1 replies (of 1 total)
  • Thread Starter ejm

    (@llizard)

    I probably should add that my theme is a child of twentytwelve….

    (I was going to edit the above post, but cannot find the edit button. :-/)

Viewing 1 replies (of 1 total)
  • The topic ‘changing “older/newer posts” wording on search results page’ is closed to new replies.