[Resolved] CPT Archive – display meta custom and before

Home Forums Support [Resolved] CPT Archive – display meta custom and before

Home Forums Support CPT Archive – display meta custom and before

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #792471
    Mario

    Hy there,
    I build a site (maintenance mode for now) and I am using two CTPs (‘slugA’ and ‘slugB’ – created by myself, child-theme functions.php) – they are working. In the next step I created an archive page for each with Elementor – works! But one thing I am not able to achieve – how can I set a custom <title> and a custom <description> (meta) in the header above <body> for each archive? Right now I get the title and the description from the latest post – which of course isn’t correct. If I got it right, WordPress creates these pages “on the fly” – if needed. Is there a way to tell (or build a) the template: “Hello, please use this title and this description for this specific Archive-Page!”?
    I asked Elementors support, already. The answer was, Elementor haven’t such mechanism. Further I have looked at WordPress Template Hierarchy – I can’t figure it out by myself, but perhaps there is the way to achieve, what I like to get?
    Any ideas or a hint?
    Mario

    #792487
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Are you using an SEO plugin like Yoast? If so, they have options for you to adjust the title for custom post types. That would be the easiest way to achieve this.

    If not, you would need to filter the default WordPress title using the document_title_parts filter.

    Let me know if you need more info ๐Ÿ™‚

    #792639
    Mario

    Grrreat – thank you, Tom!
    Good old wpSEO does the job now.

    #792918
    Tom
    Lead Developer
    Lead Developer

    Awesome ๐Ÿ™‚ Glad I could help!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.