Remove Archive Title & Description from Blog Page in Genesis
Genesis adds in an archive title and description at the top of each archive page, depending on which type of archive page you use, there is a way to remove these from the mark up on the page.
Since Genesis 2.2.1 there is a genesis_do_posts_page_heading function which adds Archive and Description markup just before the articles on a blog and archive posts page. The original markup is in /genesis/lib/structure/archive.php
Below is a snippet of that code which adds the description and title markup, this is repeated to output the archive and description for all the different archive page types. What we need to do is reverse that action by removing it via the child theme.
To remove the archive title and archive description blog page markup just remove the action below in your themes function.php file, depending on what type of archive page you are using you’ll need to remove that action from one of the list below…
remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' );
To remove from the blog page template use…
remove_action( 'genesis_before_loop', 'genesis_do_blog_template_heading' );
To remove from a date based archive use…
remove_action( 'genesis_before_loop', 'genesis_do_date_archive_title' );
To remove from a custom post type based archive use…
remove_action( 'genesis_before_loop', 'genesis_do_cpt_archive_title_description' );
To remove from a author based archive use…
remove_action( 'genesis_before_loop', 'genesis_do_author_box_archive', 15 );
remove_action( 'genesis_before_loop', 'genesis_do_author_title_description', 15 );
To remove from a taxonomy based archive including categories and tags use…
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
Hi.
I have this same problem on my site.
I don’t have any of the code you describe above. Is there another way to get rid of the box?
Thanks
The initial code is in the Genesis framework itself, I just make reference to it, it’s the code below the
remove_actions
you add to your functions.php fileOk. So, where, exactly, do I put the code? I didn’t find the add_action code you spoke of in either of the function.php files, (Genesis or Genesis Sample Theme). The “genesis/lib/structure/archive.php” is nowhere to be found either.
Thanks
The 2 remove_action snippets go in your functions.php file
Anywhere at all?
I added the lines to BOTH function.php files, at the bottom. It didn’t work either time.
I also tried putting the lines into the simple css plugin I have. Still nothing.
You only add it into the child themes functions.php file, so in your case this is the sample theme, just adding it in at the end is fine – it works I have tested – perhaps this is not the right code for you – what is the URL?
Halloweencrossroads.com
what exactly are u trying to remove?
The white archive title box. It only shows up when you go to an archived post.
I’m not seeing it – screen grab it & send actual URL
http://halloweencrossroads.com/2016/06/
Here is one of the posts. It’s the white box just above the post title.
If you’re not seeing it? Is it only my end then?
I see now – you have date based archives try this…
remove_action( 'genesis_before_loop', 'genesis_do_date_archive_title' );
Pop that into your sample theme functions.php
That did the trick. Thanks much.
Will this not leave your posts page without an H1 tag?
Yes it would, I don’t see this as an issue though, the main article full pages still have their H1’s set – where they would be set to rank more so than an archive page.
Thank you!