Skip Navigation

[Resolved] Anchor Link Returning to Top of Page when calling Post ID

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by emilyM-2 5 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1219780

I'm working on developing a new section of this site for my client, and we're creating 2 custom post types, one called ingredient categories and one called ingredients. I'm using a post relationship to display the ingredients within the category for more customizations.

On this page: hidden link I have a smaller sub-view of the ingredients list (Ingredient Sidebar Listing) which is linked to the ID of the section with the primary view of the ingredients (Fermented Ingredient Listing).

When clicked, the last item in this list is scrolling to the top instead of to the section it should be referencing. All other links work fine.

Hoping for some suggestions on how to fix this, ideally we will have each listing linked to its respective section.

Thanks!

#1220252

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Emily,

Thank you for contacting us and I'll be happy to assist.

I've checked the source code of the page that you shared and noticed that ID "209427" is repeating on it.

Screenshot 1: hidden link
Screenshot 2: hidden link

The second instance of this ID is coming from the view "Ingredient Sidebar Listing", but I'm not sure if the theme or parent Divi builder template is adding the first one. But as a result, the browser is using the first available instance of that ID for the last anchor link and the page scrolls up to the top.

To avoid this, you can add some text like "section-" before the "wpv-post-id" shortcode, in the "CSS ID" setting ( hidden link ) and the anchor link ( hidden link ).

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1221070

Thanks for looking into this for me. I discovered that instead of using the section ID option I needed to use the row ID option to create the anchor links - for whatever reason Divi sections like to mess with everything but the rows don't have this problem.

Thanks!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.