[Support request] Category Hero Page- Remove Existing Category Layout Underneath it

Home Forums Support [Support request] Category Hero Page- Remove Existing Category Layout Underneath it

Home Forums Support Category Hero Page- Remove Existing Category Layout Underneath it

  • This topic has 11 replies, 3 voices, and was last updated 1 month ago by Elvin.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2046970
    Mike

    Hi,

    I set up an element with a page hero to replace an existing category. I click on “disable title” (see screenshot) but the category title and existing layout still shows underneath my page hero that I created (see screenshot).

    Is there anyway to remove this?

    #2047127
    Elvin
    Staff
    Customer Support

    Hi Mike,

    I’ve checked the site and in question and the title you’re trying to move is added by Elementor.

    The “disable title” option will only work on titles generated by the theme.

    If you wish to remove it, you’ll have to remove it through Elementor. Try checking on Elementor’s template library if it has something for Archive pages. 🙂

    A wise man once said:
    "Have you cleared your cache?"

    #2047252
    Mike

    Thanks!!

    I still see the “standard category” page underneath though (screenshot) is there anyway to remove this?

    #2047384
    David
    Staff
    Customer Support

    Hi there,

    to remove the default archive loop you can use this PHP Snippet:

    add_filter( 'generate_do_template_part', function( $do ) {
        if ( is_category( '54' ) ) {
            return false;
        }
        return $do;
    } );

    Change the 54 to the ID of the Category.

    #2047398
    Mike

    OK, do I need a plugin to do this? Or is there any way to add this code to a page without a plugin?

    #2047510
    David
    Staff
    Customer Support

    oops was meant to add the link to this doc which explains how to add PHP:

    https://docs.generatepress.com/article/adding-php/

    #2047798
    Mike

    Is it possible to add this just for 2 category pages rather than the whole site?

    I’d just like it for this category https://stronghomegym.com/gym-equipment/
    and this one https://stronghomegym.com/guides/

    Would you be able to help? I’m a bit worried about messing up the site

    #2048022
    David
    Staff
    Customer Support

    First go to Dashboard > Posts > Categories and Edit those categories. Check in the Browser URL Field and get the IDs eg. ID=4

    Now the snippet will look like this:

    add_filter( 'generate_do_template_part', function( $do ) {
        if ( is_category( array( 66, 99 ) ) ) {
            return false;
        }
        return $do;
    } );

    Change the 66 and 99 for your category IDs

    #2048164
    Mike

    Thanks David,

    Maybe I’m a bit slow here, but I can’t see any “Browser URL Field” or IDs

    Screenshot
    Screenshot

    #2048214
    Elvin
    Staff
    Customer Support

    Hi Mike,

    It’s on your browser’s URL as shown in this example here –
    https://share.getcloudapp.com/mXuPkY40

    A wise man once said:
    "Have you cleared your cache?"

    #2048263
    Mike

    Sorry I’m feeling very silly but I don’t see it…

    https://stronghomegym.com/gym-equipment/
    https://stronghomegym.com/guides/

    #2048269
    Elvin
    Staff
    Customer Support

    Here’s a step by step:

    1.) Go to Admin > Posts > Categories
    2.) Click “Edit” on the Category you want to get the ID of.
    3.) Once you’re on the “Edit category” page, check your browser’s address bar.
    Note: The address bar is where you type in the website you visit.
    4.) You should see something like this – Example: https://share.getcloudapp.com/qGuR9Onp – on the URL, the ID is indicated.

    That’s the value you have to indicate on the PHP snippet’s condition.

    You can repeat the process for each category you need to get the ID.

    A wise man once said:
    "Have you cleared your cache?"

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