• Resolved publicradio

    (@publicradio)


    Yoast will add ids to h2-h6 tags, on pages and posts. I have a custom post type called ‘events’ where I would like this to work. How do I apply this function to other post types?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Rumejan Barbarona

    (@onlyincebu)

    Hello!

    Thanks for reaching out.

    Can you please provide us a screenshot of the “ID” you’re referring to and where is it shown on your posts and pages?

    Looking forward to your response.

    Thread Starter publicradio

    (@publicradio)

    Alright, well here’s what it looks like when I create a page in WordPress:

    https://snipboard.io/91P0pk.jpg

    In Gutenberg, I can set the ‘HTML Anchor’ for a heading under Advanced Settings, in the sidebar. This just creates an ID attribute for the tag.

    However, if I leave this blank, Yoast will create an ID for the header, based on the title itself:

    https://snipboard.io/jKuEXq.jpg

    In this example, I left the HTML Anchor field blank for the first H2, but manually entered something for the second H2. The first one’s ID was filled in by Yoast.

    This is what I want, but I also have custom post types. For instance, I use a plugin called Events Manager and it creates a custom post type called ‘Event’. When I add headings to pages or posts, Yoast attaches the auto ID. It does not do this for the custom posts.

    How do I extend this functionality to custom posts?

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Thanks for clarifying everything. While we don’t have a workaround to extend the relevant feature that you’re referring to here, we recommend you please submit it as a feature request directly on our GitHub development repository so our development team can either consider this or might provide you a workaround as well.

    Thread Starter publicradio

    (@publicradio)

    OK, I created an issue on Githib. Could you tell me where this functionality exists, in the codebase? Maybe I can pull the function and create something in my theme.

    Plugin Support devnihil

    (@devnihil)

    Unfortunately we can’t offer support on custom code. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes.

    Maybe someone watching these forums can assist you further, but if your topic is inactive for 7 days, we’ll mark it as resolved to keep the overview.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use heading automatic IDs for custom post types’ is closed to new replies.