Site logo

Archived topic

Customizing layout for archive pages with pages (not post)

31 replies · Started by marc on April 20, 2021

Viewing posts 16–30 of 32

I don't want to just hide it with CSS since it still shows a bunch of h2's in my source code.
I guess I'll just forget about the whole thing

Looks like the h2 titles are gone now, from HTML.

yes because I removed them.

Did you resolve it yourself? Nice!
How did you do that?

Nope I didn't resolve anything :/ unfortunately I just removed the CSS and php filter you provided me since it wasn't working and I couldn't remove those h2s from wpshowpost (I don't want to just hide them with css since it's bad for SEO). But thanks for your help Ying and David, I'll find another way, maybe I'll just wait for the generatepress theme builder release.

By the way, could you point to the code snippet for activing masonry grid layout for archive but for pages (not post)?
Thanks in advance

Since there's no archive page for pages, so the masonry grid won't work for pages unfortunately.

Hey guys,

since I use pages not post, my archives pages look very sad and unprofessional.

I've been trying to make them better but it's seems impossible to me.

Could you take a look at the private information I provide, I would like to have my archive pages like this specific example but I'm not able to do it myself unfortunately.

I did use all the css and else you provided me in this thread but unfortunately it doesn't look good at all :-/

Thanks in advance

Oops sorry, just added it again.

Just to confirm, was it this function that added the titles to WPSP?: https://generatepress.com/forums/topic/entry-title-over-post-image-for-archives/#post-1705340

If so, you could do this instead:

add_action( 'post_thumbnail_html', 'db_title_over_archive_featured_image', 10 );
function db_title_over_archive_featured_image( $html ) {
    if ( ! is_singular() ) {
      $params = generate_get_the_title_parameters();
      $html .= '<h2 class="entry-title" itemprop="headline">' . get_the_title() . '</h2>';
    }
    return $html;
}

Alternatively, use a Content Template to build your archives however you want: https://docs.generatepress.com/article/block-element-content-template/

Hi Tom,

Yes indeed it is that function, I'll try the one you just provided and will let you know however I would much rather use a content template to build my archives.

Is it safe to use on a live site yet? I didn't go for that option because it says it's only available for public testing.

Thanks,
Marc

GPP 2.0 has been officially released, you can start to use them on live site now :)

Awesome thanks Ying I'll give it a go

Ok so generateblocks is just awesome, thanks a lot :D

One last question thought: is there a way to make a specific page sticky on my archive pages? (considering I use pages with categories and not post).

Thanks in advance.

Marc

Hi there,

i don't think that is possible as the Sticky option i believe is hardcoded for the 'posts' and cannot be applied to other post-types.

See here for the full Trac that started 11 years ago (!!) on this particular subject:

https://core.trac.wordpress.org/ticket/12702

You will see the last replies - is that WP doesn't 'like' the Sticky featured and don't want to propagate its use lol

This archived topic is closed to new replies.