WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress Default Theme Navigation (5 posts)

  1. zdebx
    Member
    Posted 4 years ago #

    I'm trying to remove the "next" and "previous" post links above each post that I have on my blog (using default Kubrick theme)

    So what I'm talking about are the links between the header and the actual post.

    I searched around, and found out that I need to change "add_action" to "remove_action" in the default-filters php file, located in wp-includes folder.

    Here's what I've done:

    remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
    remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
    remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );

    However, the problem is that I still get the links displayed to next and previous posts, as normal.

    Any ideas?

    Thanks in advance

  2. keesiemeijer
    moderator
    Posted 4 years ago #

    I think that is on a single post page. Just look in single.php and delete:

    <div class="navigation">
    			<div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
    			<div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
    		</div>

    right after
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

  3. esmi
    Forum Moderator
    Posted 4 years ago #

    I'd actually re-insert those actions that you removed as well. They output link rel lines in the <head></head> section that are not displayed on the page but that are used by some kinds of assistive software to provide additional user support.

  4. zdebx
    Member
    Posted 4 years ago #

    keesiemeijer, thank you very much! That's exactly what I needed. Works perfect now.

    esmi, I've readded those actions, as you recommended.

    Thanks for the quick responses guys. Appreciate that.

    Good luck

  5. keesiemeijer
    moderator
    Posted 4 years ago #

    Glad you got it working! Now, please use the dropdown at top right to mark this topic 'Resolved'.

Topic Closed

This topic has been closed to new replies.

About this Topic