Home>Support>Remove Post navigation

Remove Post navigation

By Judy Tan, 9 years ago. Last reply by Andrew Misplon, 9 years ago.

Hi,

I see my posts have this

 <h1 class="assistive-text">Post navigation</h1>
in the source file. I not sure what’s the purpose of it but i would like to change the h1 to something else.

I am currently using vantage theme. I have a child theme for it too.

Please help me. Appreciate your help.

URL: http://www.alvaircon.com/articles/why-aircon-becomes-colder-after-chemical-washing/

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 3 months ago Andrew Misplon
    Hi, I Work Here

    Hi Judy

    Thanks for reaching out.

    The string you’re seeing is part of the theme’s accessibility features. Screen readers help the visually impaired, assistive text like the above helps Screen Readers make better sense of the site.

    If you browse in the parent theme to /inc/template-tags.php you’ll find a function on line 10 called vantage_content_nav. Copy lines 11 to 64 and insert them into your child theme functions.php file:

    function vantage_content_nav( $nav_id ) {
    	if( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'infinite-scroll' ) ) {
    		return;
    	}
    	global $wp_query, $post;
    
    	// Don't print empty markup on single pages if there's nowhere to navigate.
    	if ( is_single() ) {
    		$previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
    		$next = get_adjacent_post( false, '', false );
    
    		if ( ! $next && ! $previous )
    			return;
    	}
    
    	// Don't print empty markup in archives if there's only one page.
    	if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) )
    		return;
    
    	// Add the shorten title filter
    	add_filter('the_title', 'vantage_content_nav_shorten_title');
    
    	$nav_class = 'site-navigation paging-navigation';
    	if ( is_single() )
    		$nav_class = 'site-navigation post-navigation';
    
    	?>
    	<nav role="navigation" id="<?php echo esc_attr( $nav_id ); ?>" class="<?php echo $nav_class; ?>">
    		<h1 class="assistive-text"><?php _e( 'Post navigation', 'vantage' ); ?></h1>
    
    	<?php if ( is_single() ) : // navigation links for single posts ?>
    
    		<div class="single-nav-wrapper">
    			<?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'vantage' ) . '</span> %title' ); ?>
    			<?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'vantage' ) . '</span>' ); ?>
    		</div>
    
    	<?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>
    
    		<?php vantage_pagination() ?>
    
    	<?php endif; ?>
    
    	</nav><!-- #<?php echo esc_html( $nav_id ); ?> -->
    	<?php
    
    	// Remove the shorten title filter
    	remove_filter('the_title', 'vantage_content_nav_shorten_title');
    }
    

    You can then edit the assistive text string in that function as required.

  2. 9 years, 3 months ago Judy Tan

    Hi Andrew,

    Thanks for your reply! It worked perfectly! Thanks!

  3. 9 years, 3 months ago Andrew Misplon
    Hi, I Work Here

    Awesome :) Glad to hear that helped.

    All the best.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More