Site logo

[Resolved] How to hide CPT Archive titles?

Home Forums Support [Resolved] How to hide CPT Archive titles?

Home Forums Support How to hide CPT Archive titles?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2082563
    Ema

    Hello,
    I’d like to hide the archive titles on CPT archive pages.

    I’ve tried disabling via elements/layout/disable content title and adding the display conditions
    and this code

    add_action( 'wp', 'lh_remove_archive_title' );
    function lh_remove_archive_title() {
            remove_action( 'generate_archive_title', 'generate_archive_title' );
    }

    I have the titles in the hero section, so don’t need to repeat them. But they just won’t budge.

    Ema

    #2082584
    Leo
    Staff
    Customer Support

    Hi there,

    Are you trying to remove this?
    https://www.screencast.com/t/vSejqyihuU

    If so you would need to add the CPT archives to the Exclusion section of the element.

    Let me know if this helps 🙂

    #2082612
    Ema

    Leo, I managed to do it with the code above after all! It was the hero title in the block, I wanted to keep – then remove the generated archive title which would appear below. Thank you!

    #2082648
    Leo
    Staff
    Customer Support

    No problem 🙂

    #2103029
    Brad

    Hi. I was trying to do the same thing and the function above worked for me too! thanks for posting. Question? Where did you find or how did you come up with the syntax to write the function if you don’t mind me asking? Is there a generate press codex of sorts?

    Sincere thanks in advance for your time.

    #2103122
    Ying
    Staff
    Customer Support

    Hi Brad,

    All the codes are in GP’s files, if you are familiar with PHP, you should be able to read the codes and find out how to remove/add/modify/filter the original codes 🙂

    #2156471
    Antar

    The code works – which is great.

    the question is, why doesn’t Disable Content – “Content Title” work for archives when activated in a page layout?

    #2156843
    David
    Staff
    Customer Support

    Hi there,

    The Disable Content Title only applies to a post content title, the Archive Titles are a different function. Its something we may address when we next review the Layout Element.

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