Skip to:
Content
Pages
Categories
Search
Top
Bottom

Scroll down user profile page

  • @aldebaranmirko

    Participant

    Hello to all,
    I have a little problem, when I’m having a great header in the user profile page every time I click any item in the profile page refreshes brought me back to the top.
    you always need to scroll down and it is very annoying.
    you can anchor only that page so that it opens automatically below the header?
    thanks in advance

    sorry for my english ….

    Buddypress 2.01, wp 3.91

Viewing 6 replies - 1 through 6 (of 6 total)
  • @henrywright

    Moderator

    This will need JavaScript.

    @aldebaranmirko

    Participant

    ok, but do not know how you do it, anyone can help me?

    @henrywright

    Moderator

    Try finding your <body> tag in header.php then add an onload event attribute like this:

    <body onload=' location.href="#anchor" '>

    Then in your template:

    <div id='anchor'>whatever</div>

    When the page loads ‘whatever’ will be at the top of your screen.

    @aldebaranmirko

    Participant

    thank you very much, but it definitely works because I entered the code incorrectly.

    I use RTpanel theme then /wp-content/themes/rtpanel/header.php post at bottom:

    <body onload=’ location.href=”#anchor” ‘>

    while <div id=’anchor’>whatever</div> in wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php

    the page to jump below the header is that of the user profile BuddyPress, where there is activity, friends, groups, messages, etc …

    then I did not understand the ‘whatever’
    sorry but it is my first website, I have already learned a lot and I would also fix this thing

    thanks again

    @henrywright

    Moderator

    ‘whatever’ can be anything. I was using it as an example. In your case, it will be an image, or some text or anything. The key bit to understand is whichever page element you put id='anchor' on is the page element that will appear at the top of your page, on page load.

    @aldebaranmirko

    Participant

    I got it!
    thank you very much!
    it works!

    however, appears in the permalink / # anchor, is this normal? can be removed?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Scroll down user profile page’ is closed to new replies.
Skip to toolbar