Make a navigation menu in the same post

I have been trying for some time to do one thing: I need a navigation menu inside a WordPress post which will guide the user to different subsections of my post, and then maybe use a “Top” button to go back to the top. Let me give you an example:

Title

Read More

Introduction “jnkdjajkfa”

Menu

Section one – this is a link

Section two – this is a link

Conclusion – this is a link

Section one
“bdsjkbdfsjbfjkasbjkbfasbjf”

Back to top – this is a link

Section two
“dnjsdkfhbsjukfbajfkbjkfbkasbfjk”

Back to top – this is a link

Conclusion
“ndjasndkasnj”

Back to top – this is a link

I know I can do this in the code, but it’s really a pain to do it on every post. Do you know a plugin, method to easily do this? Any help is very appreciated.

Related posts

Leave a Reply

1 comment

  1. You can simply put The code in the php file in your theme.If you use twentyeleven theme open content-single.php, find the line

    <h1 class="entry-title"><?php the_title(); ?></h1>
    

    And after it put your divs and top menu.

    Another option is to create a widget where you could easily update the html code.

    Instead your divs, below this line

    <h1 class="entry-title"><?php the_title(); ?></h1>
    

    paste this:

    <?php if ( ! dynamic_sidebar( 'links-below-post-title' ) ) : ?>
    

    Also in fuctions.php after

    function twentyeleven_widgets_init() {
    

    add this:

    register_sidebar( array(
            'name' => __( 'Links Below Post Title', 'twentyeleven' ),
            'id' => 'links-below-post-title',
            'before_widget' => '',
            'after_widget' => "",
            'before_title' => '',
            'after_title' => '',
        ) );