Site logo

Archived topic

Create custom category page with Generate Blocks

20 replies · Started by Ales on February 26, 2021

Viewing posts 16–21 of 21

Hi David,

Thanks a lot. It helped. Just one more question, is there any way how to use this code to remove H1 only from archives I specify? This is a site-wide solution.

Also, I would like to get back to this:

3) When I look into the code, there are blank spaces inside the H1 tag, why is that, please?

This seems to be a thing for every site that uses GeneratePress. Not only mine.

Thanks!
Ales

You would need to add a condition to that snippet:

add_action( 'wp', 'lh_remove_archive_title' );
function lh_remove_archive_title() {
  if (is_category(array('cat-1', 'cat-2', 'cat-3'))) {
    remove_action( 'generate_archive_title', 'generate_archive_title' );
  }  
}

If you're checking the source code of the site you will see the tab spacing that is in the PHP code that generates the output - it can be ignored.

Hi David,

Thanks a lot! That should be all, so I am marking the thread as resolved.

Ales

You're welcome

Hello,

I would like to make post category archives that contains both content and an excerpt of the category.

I know there is a category description, but I would like to use blocks to create the description, is it possible?
Or can I just insert this description inside a dynamic block?

And regarding the excerpt, I think the only way to add it is using an ACF, can I use an ACF inside a dynamic block?

Thanks!
Gal

This archived topic is closed to new replies.