[Resolved] Category page – posts

Home Forums Support [Resolved] Category page – posts

Home Forums Support Category page – posts

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2043037
    Nenad

    I’d like to achieve the following (or close to) look for category pages: https://www.bikemag.com/gear/
    Ignore top part of the page, and menu (“latest”, “bikes”, “components”…), I’d like just to get a section below that for every category page on my site.

    So, image left, title, excerpt, author and category on the right. Is this possible to do on my site?

    #2043042
    Elvin
    Staff
    Customer Support

    Hi there,

    I see you’re using a third-party plugin to display post loops on the page. You’ll have to contact the plugin’s support if they have some sort of add-on or option to change the layout of the post items.

    If the plugin doesn’t have that, I’d suggest getting a plugin that allows users to customize it enough for your desired layout.

    You may want to try something else on the list – https://wordpress.org/plugins/search/post+grid/

    Note: I’d recommend WP Show Post Pro but it’s sales are temporarily halted as the merge between GenerateBlocks and WP Show Posts is on the way. Target release date is Q1 2022.

    A wise man once said:
    "Have you cleared your cache?"

    #2043043
    Nenad

    Hi, Elvin, you’re referring to the home page, and not the category page.
    We’re using plugin for home page, but not for category pages (domain.com/category).

    #2043046
    Elvin
    Staff
    Customer Support

    Ah that’s very good then!

    This means you can use Block Element – Content template to change the post item template of the post items as it’s a default archive page.

    Check this demo to get the idea – https://www.youtube.com/watch?v=-ZTQP_KA2xE

    Block Element – Content template basically lets users create how their post items are going to be displayed. While the demo on the video doesn’t exactly match what you were aiming for, this should give you an idea on what to do.

    You can create your own layout template using Block editor with this. πŸ˜€

    A wise man once said:
    "Have you cleared your cache?"

    #2043048
    Nenad

    I’m on the classic editor on all of my sites, and I don’t really like to use blocks/Gutenberg, but will give it a try for this purpose. Thanks!

    #2043052
    Elvin
    Staff
    Customer Support

    I’d suggest considering use of Gutenberg to fully utilize the capabilities of GP Premium. πŸ™‚

    If in case you wish to not use it and stick w/ pure Classic Editor, the way to go is by making your own layout with child theme templates for your archive page or by adding hooks + custom CSS to group things out.

    A wise man once said:
    "Have you cleared your cache?"

    #2043058
    Nenad

    I do have a child theme active.

    If you have free time to assist with it – that’s great, if not – no worries at all.
    I’ll check video in the morning. πŸ™‚

    #2043067
    Elvin
    Staff
    Customer Support

    As for the hook method,

    You first set the featured image location to – https://share.getcloudapp.com/8Lu98A9P (setting is found on Appearance > Customize > Layout > Blog)

    You then add this PHP snippet:

    add_action('generate_before_content',function(){ 
    	if( is_archive() ){
    		echo '<div class="content-wrapper">'; 
    	}
    	
    },11);
    
    add_action('generate_after_content',function(){ 
    	if( is_archive() ){
    		echo '</div>'; 
    	}
    },20);

    You then add this CSS:

    body.archive #main .inside-article {
        display: flex;
        align-items: center;
    }
    
    body.archive #main .inside-article .post-image {
        width: fit-content;
    }
    
    body.archive #main .inside-article .content-wrapper {
        padding: 0 30px;
        flex: 1 1 auto;
    }

    A wise man once said:
    "Have you cleared your cache?"

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