Forums

Anchored Links in Sidebar (4 posts)

  1. med123
    Member
    Posted 3 years ago #

    Hi,

    the content on some of my pages will be split into sections such as;

    Abstract
    Introduction
    Method
    ...and so on.

    I would like the sidebar to contain links to these sections, anchored links to be precise. I can visualise how it's going to work, but I've never really delved into php, only edited it here and there.

    So does anyone know how I can achieve this? This needs to be something generic of course so that it would work on any page.

    Actually while typing I've realised something, not all the content may have those precise headings, some may not have an introduction for example, so is there any way for the sidebar to pull these section headings from the page dynamically when it loads and generate a list of links based on the headings present?

    I'm using 2.7

  2. med123
    Member
    Posted 3 years ago #

    *bump

  3. Ryan S
    Member
    Posted 3 years ago #

    well, you can create the categories and add the posts to the relative category. Then you can add the category widget to your sidebar.. This will show the links to the various sections of your blog in your sidebar..

  4. viceng
    Member
    Posted 3 years ago #

    this has nothing to do with php or wordpress...this is plain old html

    <a href="#anchor">go to anchor</a>
    .
    ,
    ,
    <a name="anchor"> you are here </a>

    I would suggest breaking up your document page into shorter pages and then linking to them as opposed to a long page using named anchors.

Topic Closed

This topic has been closed to new replies.

About this Topic