0

I have a CPT named "especialidades", so right now the page have URLs likes this ones: webpage.com/especialidades/some-name

webpage.com/especialidades/other-name

The template for this CPT shows tabs, in each tab is visible a block of HTML from a field created with Advanced Custom Fields.

I need to add URLs for each tab. Examples:

webpage.com/especialidades/some-name/tab1

webpage.com/especialidades/some-name/other-tab

So when you enter in this URLs the tab of the URL is the one selected on the page.

Please advice (and sorry for my english)!

Edit: I need the URLs to be indexable by search engines so using something like #tab-name doesnt work for me

  • Please share the template that creates the tabs. That will be important in determining whether it is even possible to navigate directly to a page with a particular tab open. – WebElaine Nov 12 at 20:35
  • look this to add a parameter in URL : wordpress.stackexchange.com/questions/352189/… – Kaperto Nov 12 at 20:40
  • 1
    What @WebElaine said. :) Also, if you are open to it, consider using the ID of each tab in the URL instead, so for instance webpage.com/especialidades/other-name/#tab1, webpage.com/especialidades/other-name/#tab2. Here is a tutorial on how to do that with the repeater field of ACF: acfextras.com/… – Michelle Nov 12 at 20:45
  • @WebElaine is a simple HTML/JS tabs structure and I can edit this to fit with the solution for the URL's problem – Agustín Fiori Nov 12 at 21:28
  • @Michelle I need different URLs so this can be indexed by search engines. Using #tab-name don't solve my problem – Agustín Fiori Nov 12 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.