- This topic has 11 replies, 3 voices, and was last updated 2 years, 3 months ago by Elvin.
-
AuthorPosts
-
December 12, 2021 at 7:41 pm #2046970Mike
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?
December 13, 2021 at 1:05 am #2047127ElvinStaffCustomer SupportHi 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. 🙂
December 13, 2021 at 3:10 am #2047252MikeThanks!!
I still see the “standard category” page underneath though (screenshot) is there anyway to remove this?
December 13, 2021 at 5:28 am #2047384DavidStaffCustomer SupportHi 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.December 13, 2021 at 5:42 am #2047398MikeOK, do I need a plugin to do this? Or is there any way to add this code to a page without a plugin?
December 13, 2021 at 7:14 am #2047510DavidStaffCustomer Supportoops was meant to add the link to this doc which explains how to add PHP:
December 13, 2021 at 10:17 am #2047798MikeIs 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
December 13, 2021 at 3:25 pm #2048022DavidStaffCustomer SupportFirst 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
December 13, 2021 at 7:44 pm #2048164MikeThanks David,
Maybe I’m a bit slow here, but I can’t see any “Browser URL Field” or IDs
December 13, 2021 at 9:27 pm #2048214ElvinStaffCustomer SupportHi Mike,
It’s on your browser’s URL as shown in this example here –
https://share.getcloudapp.com/mXuPkY40December 13, 2021 at 10:55 pm #2048263MikeSorry I’m feeling very silly but I don’t see it…
https://stronghomegym.com/gym-equipment/
https://stronghomegym.com/guides/December 13, 2021 at 11:08 pm #2048269ElvinStaffCustomer SupportHere’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.
-
AuthorPosts
- You must be logged in to reply to this topic.