Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Inserting Archive Card element to a page (homepage)

  • I did try, I added a screen recording to private

  • The settings you did in the video are correct, have you cleared cache or just disable cache plugin as it’s a staging site?

    And can you provide an admin login to the staging site so I can see the settings?

  • Sure I disabled the plugins and purged everything, but doesn’t seem to be a caching issue

    Added login to staging in private

  • Forgot to tell you to remove Front page from the Archive card element, as the Homepage page is now the Front page, I’ve removed it and now the posts show:
    https://app.screencast.com/Jz0xKLZWaPNvZ

    For other elements that you want to add to the front page (homepage), you need to remove pages > homepage, and add font page to the element’s location, eg. Email Newsletter Section, GetStartedHere, Home Page Intro.

  • Ah, I see, thanks. But, as far as I can see, there’s no way to select “Front Page” under the reading settings? The idea of recreating the live domain landing page as a separate page is so that it could be selected under the “Homepage:” setting https://imgur.com/a/zld5rJh

    Edit: ah nevermind, the “Homepage” was somehow made the “Front Page?”

  • Okay well elements are in place, although the archive cards now needs a bit of work to reach the same look as on the live domain landing page.

    1. Color, right now the “Archive Cards” on live domain has grey background, with white background around the cards themselves. I understand that it’s not possible to set the “Query Loop” background to grey somehow or the grid under it? I’m not really seeing any options for that, the “Post Template” that comes after grid does let me choose a color but that already outlines the individual archive card container itself. https://imgur.com/a/4jdfnsn

    2. Force it to 1×3 grid like on live domain, right now on live the following PHP does that, I just have to switch something with “homepage” here? Sorry I have 0 PHP experience

    function custom_posts_per_page_for_blog( $query ) {
    if ( $query->is_main_query() && $query->is_home() ) {
    $query->set( ‘posts_per_page’, 3 );
    $query->set( ‘no_found_rows’, true ); // Disable pagination calculation

    // Set found_posts to 3 to eliminate pagination
    global $wp_query;
    $wp_query->found_posts = 3;
    }
    }
    add_action( ‘pre_get_posts’, ‘custom_posts_per_page_for_blog’ );

  • For question 1:

    1. Go edit the homepage, select the query loop block, click add to container button, set the newly added container’s max-width to 1200px, set margin-left and margin-right to auto.

    2. Select the post template container, set the background color to white.

    For question 2:

    You do not need the PHP code, just select the query loop block on the homepage, and set posts per page to 3.

  • Sorry for the late response, okay so posts is set to 3, but it shows 4. In addition to that, colors aren’t applying quite right, despite everything being nested in the added container it doesnt really apply the background color fully, and it’s also not stretching across.

  • okay so posts is set to 3, but it shows 4

    Do you have any sticky posts? If so, it will be on top of the 3 latest posts.

    You can either set posts per page to 2, or add sticky parameter, and set it to ignore.

    In addition to that, colors aren’t applying quite right, despite everything being nested in the added container it doesnt really apply the background color fully

    Click the container, and click the add to container button again, this new container will be full width, set background color for it.

  • Hm I don’t recall setting any sticky posts or anything like that. I set it to 2 for now, seems to look ok on front end.

    Alright that did the trick with the background. Ok so I have this code that I kind of brute forced with GPT that makes sure everything is symmetrical and starts on the same line. It’s applied on staging too, but the excerpt doesn’t stop at line 3 like it does on live.

    .gb-container.gb-container-6281de8b {
    max-width: 400px; /* Adjust the max-width according to your preference */
    overflow: hidden; /* Hide any content that exceeds the container */
    }

    .gb-container.gb-container-6281de8b h2 {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Adjust the number of lines to display */
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%; /* Adjust the max-width according to your preference */
    line-height: 1.5em; /* Adjust the line-height for spacing between lines */
    }

    Also, it seems to pull the latest article from way back in January? Where can I find what’s causing that?

  • Hm I don’t recall setting any sticky posts or anything like that

    You did:https://app.screencast.com/hAly5nxeoSa3D

    For the h2, the CSS works:
    https://app.screencast.com/UNrMRKtOw6vhj

    However, below CSS is not needed as it can be done in the block settings:

    .gb-container.gb-container-6281de8b {
    max-width: 400px; /* Adjust the max-width according to your preference */
    overflow: hidden; /* Hide any content that exceeds the container */
    }

    Your latest post is this one and the query loop pulls it correctly as the 2nd post, the 1st post is the sticky post:
    https://app.screencast.com/gqIGpXAoWT0Lx

  • Ahh okay, didn’t intend to sticky anything so was a mistake, thanks.

    It does work for titles, I meant the excerpt, it doesn’t work for that but on live it does https://imgur.com/a/2oLcxuB

  • So everything’s working now?

    Let me know if there are any other questions regarding this 🙂

  • Sorry no, excerpt is still not limited to 3 lines, I would like to replicate what you can see on live domain right now. In essence, 3 things left for this one.

    1. Limit excerpt to 3 lines (yes titles are fine, I mean the main text)
    2. Space out containers between one another (right now there’s no gray space separating containers like you see on live)
    3. Get rid of the white space below (I’m guessing this should sort itself out if excerpt are limited to 3 lines)

    I also disabled sticky post but its still not pulling the completely latest article for some reason/

    Edit: Ok I found the fix to number 2, I just need help with the number 1 + latest article then and should be done I think.

  • 1. you can NOT limit the expert to 3 lines, but you can set the excerpt word number, your current live site excerpt word count is set to 14, do the same for your staging site.

    3. select the post template block, set height to 100%. If you want to add some space below, set a margin-bottom or padding-bottom for the container that contains the query loop block.

  • 1. Ah ok, sorry I completely forgot how I did it on live since it’s been a while, thank you.

    3. Height set to 100% but setting margin/padding just pushes the white space around currently.

    How can I also find what is preventing the most latest article from being displayed in the archive cards? It starts from the second one currently

Viewing 16 posts - 17 through 32 (of 35 total)
  • You must be logged in to reply to this topic.