Support » Fixing WordPress » Anchor Points only on post pages

  • Hello,

    I have been researching anchor points, and how to make the page automatically scroll down to a given point on the page. Although, I am having some troubles.

    On each page, the URL ends with #video. And on every page that has a wordpress post, it automatically scrolls down to where I want it to. But, I only want the url to contain #video if it is a post page (not the index, about us, etc)

    I found this thread:

    And so my header contains:

    <script type="text/javascript">
    function goToAnchor() {
    location.href ="#myAnchor";

    <body onload="goToAnchor();">

    Basically, I only want it to “onload=”goToAnchor();” if the page is a page with a post on it. How would I go about doing this?



Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Anchor Points only on post pages’ is closed to new replies.