Site logo

Archived topic

Remove it from source code to?

5 replies · Started by oboyhehehe on September 6, 2017

Viewing posts 1–6 of 6

Hi,

I'm trying to remove the next/prev links at the bottom of a post

so far I did custom CSS:
.entry-meta {
display: none;
}

that makes it disappear visually, but when I right click source code I still see the link with text and rel="prev" and rel="next"

How do I remove that function completely I don't need it

Thank you appreciate it :)

Hi there,

This is an option in the upcoming GPP 1.5.

For now, you can do this:

add_filter( 'next_post_link', '__return_false' );
add_filter( 'previous_post_link', '__return_false' );

Cool thanks!

You're welcome!

Sorry for asking again but where do I put that code?

I use child theme and this is how my functions.php looks now:

<?php
/**
 * Generate child theme functions and definitions
 *
 * @package Generate
 */
 
if ( ! function_exists( 'generate_posted_on' ) ) :
/**
 * Prints HTML with meta information for the current post-date/time and author.
 */
function generate_posted_on() {

	if ( 'post' !== get_post_type() )
		return;

	printf( __( '<span class="byline">%1$s</span>', 'generate' ),
		sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%1$s <span class="author-name" itemprop="name">%2$s</span></span>',
			__( 'by','generate'),
			esc_html( get_the_author() )
		)
	);
}
endif;

add_filter( 'next_post_link', '__return_false' );
add_filter( 'previous_post_link', '__return_false' );

But it doesn't work the rel="prev" still shows in the source code.
Thanks!

Can you link me to your site?

This archived topic is closed to new replies.