Site logo

[Resolved] Customizing archive pages (categories and tags)

Home Forums Support [Resolved] Customizing archive pages (categories and tags)

Home Forums Support Customizing archive pages (categories and tags)

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2471198
    ch1800

    Hello,

    I’m still using WP Show Posts on some sites and it works fine with Classic Editor.
    But when clicking on WP archive pages for categories or tags I’m getting a different layout than those created by WP Show Posts and it’s normal.

    In order to have something homogeneous, is there a way to redirect archive pages to specific WP Show Posts lists that I create for them?

    PS: I know that WP Show Posts is no longer supported, thanks.

    #2471203
    Fernando
    Customer Support

    Hello there,

    Here’s an article for that: https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/

    You can also opt to use a Block Element – Loop Template if you’re open to using the Block Editor.

    #2471205
    ch1800

    Great, many thanks!
    The first link will do the job just fine as I never use those terrible blocks.

    #2471207
    Fernando
    Customer Support

    You’re welcome!

    #2472007
    ch1800

    Just to be sure I understand correctly:

    I get it the page needs to have the same slug as the category but in the following section:

     if ( isset( $query_vars['category_name'] ) ) {
            $pagename = $query_vars['category_name'];
    
            $query_vars = array( 'pagename' => "$pagename" );

    should I edit only the “category_name” or also the “pagename” in this snippet?

    #2472249
    David
    Staff
    Customer Support

    Hi there,

    you don’t need to change anything in the code, it does it all for you.
    ie. if the query var is a category then make it a page that has the same slug as the original category.

    If you have a LOT of categories, each of those will require a matching static page and WP Show Post lists, which can be a lot of work. Maybe we could style the archives to look like your WP Show posts lists ?

    #2472322
    ch1800

    Thanks for the clarification, got it.
    But yes, I think you are right for this particular site, which is mainly an archive of press clippings.
    Too many taxonomies and making the archive pages look like those of WPSP would make more sense.

    I tried to play a bit by myself but I failed.
    I include here the related links; if you have time for help it would be great.
    Nothing urgent though.

    PS: I’ll post also another remark on my other post about post archive listings as it’s for the same site.

    #2472334
    David
    Staff
    Customer Support

    Maybe:

    1. Customizer > Layout > Blog –> Featured Images >>> Archive tab.
    1.1 Set the Location to Below Title
    1.2 Check: Display Padding Around Featured Images

    2. Add this CSS:

    
    .separate-containers .generate-columns .inside-article {
        padding: 10px;
        text-align: left;
    }
    .generate-columns .entry-header, .generate-columns .entry-title,
    .generate-columns .entry-header, .generate-columns .entry-meta,
    .separate-containers .generate-columns .inside-article .post-image {
        margin-bottom: 10px;
    }
    .generate-columns .inside-article .entry-summary {
        margin-top: 0;
    
    }
    .generate-columns .entry-header, .generate-columns .entry-meta {
        text-align: left;
        font-family: Overlock, display;
        font-weight: 400;
        font-size: 1em;
    }
    #2472351
    ch1800

    Wow, this is impressive!
    In fact I now like this result more than the one by WPSP and I really wonder if I’ll replace those made by WPSP with those archives as, for this particular site, there is no real need of the plugin.

    Thanks a lot and happy holidays!

    #2472353
    David
    Staff
    Customer Support

    Glad to be of help!
    And Happy Holidays to your too !!

    #2472355
    ch1800

    PS – sorry I forgot:
    why is that the title of those archive pages is aligned that way, half on the way to left alignment but no there yet?
    Is there a way to get it centred?

    #2472656
    ch1800

    I added this, seems to work:

    .separate-containers .page-header {
        text-align: center;
    }
    #2473525
    David
    Staff
    Customer Support

    Glad to hear that !

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