Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:20:06+00:00 2026-06-06T07:20:06+00:00

I am working on a WordPress blog where there is going to be an

  • 0

I am working on a WordPress blog where there is going to be an option to have a Table of Contents (TOC) auto created from an articles Heading tags <H2> <H3> <H4>

Table of Contents links auto created from Heading tags in the page content…

<a href="#item1">TOC Item 1</a>

<a href="#item2">TOC Item 2</a>

<a href="#item3">TOC Item 3</a>

The target to these links in the page…

<h2 id="item1">TOC Item 1</h2>

<h2 id="item2">TOC Item 2</h2>

<h2 id="item3">TOC Item 3</h2>

My problem is the theme I am working on has a Fixed header that is around 50 pixels. So when you click a link in the Table of Contents to go to it’s target id, the item is hidden because of the 50 pixel header.

I am hoping to figure out a solution so that I can make the link go to a position on the page that will always be 50 pixels or so higher in the page then the actual target ID is located.

Any ideas on a solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:20:08+00:00Added an answer on June 6, 2026 at 7:20 am

    Something like this would work:

    <h2><span style="position: absolute; margin-top: -50px;" id="item1"></span>TOC Item 1</h2>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a blog migration from a custom built blog to Wordpress. One
I created a wordpress blog. Its is working fine in local. When i copied
I'm working on a Wordpress blog. I'm embedding a stylesheet as follows: <link rel=stylesheet
I am currently working on a Wordpress blog installation. Problem i am facing is
I'm working on a wordpress site, with a blog post that ends like: http://www.blog.com/?p=2
I am working with wordpress and I have to display a menu based on
I am working on wordpress and I have to add a metabox in case
I am working on a WordPress site and I have placed the following code
I just started using Wordpress 3.0 to get a simple blog up and going.
I have created a category template in Wordpress for all posts that are in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.