Site logo

[Resolved] Trying to Set up Post Grid Pro Layout

Home Forums Support [Resolved] Trying to Set up Post Grid Pro Layout

Home Forums Support Trying to Set up Post Grid Pro Layout

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #789442
    Christopher

    New to GP Premium, with Beaver Builder. So far very impressed with the functionality–was able to eliminate a lot of plugins that were previously required to set up and style my site.

    The one place I’m running into some problems is with a post grid on the main Blog/Archives page. I’ve been using Post Grid Pro on my site, which in addition to layout options allows me to define what posts are displayed, and to create additional grids of posts on other pages. I’ve been trying to replicate the layout functionality with GP, but it seems like a lot more customization work to get the same results (and I haven’t been coding for years).

    I can easily set up a Post Grid on a page within GPP, and it works fine, but can you point me to where to place the short code for Post Grid Pro in the GPP template for rendering the main Blog page? In my previous theme it’s in the Loop. But I can’t find a similar point in the GPP theme. I thought I found it on the Archives.php template, but it failed.

    Thank you!

    #789554
    Leo
    Staff
    Customer Support

    Hi there,

    If I understand correctly, you are trying to add content to the blog/archive page?

    If so you can use our Hooks Elements:
    https://docs.generatepress.com/article/hooks-element-overview/
    https://docs.generatepress.com/article/hooks-visual-guide/#posts-page

    I’m not sure what Post Grid does but Tom’s WP Show Posts might be worth considering as well:
    https://wordpress.org/plugins/wp-show-posts/

    Let me know if this helps 🙂

    #789585
    Christopher

    Thanks, Leo. I’ll check out the Hooks. To clarify, Post Grid does not ~add~ content to the blog archive page. Although the plugin can be used to add posts to a page or a sidebar widget, the short code can also be used to replace the Loop generating posts on the archive page, and then it overrides the style and selection of the Archive posts , and renders it as a grid according to the style configurations you make in the settings. You can see it on my blog page at http://www.socialrep.com/blog.

    I can currently create the same layout when I use the plugin on GPP and add the code to a new page, but I can’t figure out where in the theme the Loop is being managed so I can insert the short code and override the Loop on the archive page to look like it does on my current blog.

    I’m reviewing the Hooks now to see if it’s obvious. Thanks!

    #789609
    Christopher

    Looks like Tom’s plug-in will allow me to replicate what Post Grid does on pages other than the Archive page (ie: add a selection of posts to any page), but not allow me to easily re-render the style and selection of posts on the archive page.

    It looks like the Loop is in the Contents.php file. If I replace everything inside the <article> tags with the Post Grid short code, it comes really close to rendering the page I want–but it creates two identical side-by-side Post Grid displays…

    #790113
    Tom
    Lead Developer
    Lead Developer

    but it creates two identical side-by-side Post Grid displays…

    Not too sure what you mean by this. Is there a specific page I can check it out on?

    #790421
    Christopher

    Sure. Thanks for checking.

    Here’s a page that has the Short Code added, and it appears as expected. http://dev.socialrep.com/blog-2/

    Here’s how it looks on the Blog Archive page when I replace the Loop code on Content.php with the Short code. http://dev.socialrep.com/blog/

    Here’s what my short code replacement hack looks like:

    <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?> <?php generate_do_microdata( ‘article’ ); ?>>
    <?php echo do_shortcode(“[post_grid id=’2228′]”); ?>
    <!– .inside-article –>
    </article><!– #post-## –>

    If I remove the <article> tags altogether, only one instance appears, but the column collapses over the Post Grid. I’m sure some CSS could fix that, but I’m not sure if I’m losing something else by dropping the <article> tage.

    Thanks, Tom.

    #790547
    Tom
    Lead Developer
    Lead Developer

    Try turning columns off inside the GPP settings: Customize > Layout > Blog

    #790549
    Christopher

    You’re brilliant. Thank you!

    #790553
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #794959
    Christopher

    Just to tie off on this issue, in case anyone else using Post Grid asks–I ultimately ended up removing Post Grid and using CSS to restyle it the way I wanted. Post Grid was taking much too long to load.

    #794997
    Tom
    Lead Developer
    Lead Developer

    Good call 🙂

    Thanks for the update!

    #795108
    Christopher

    Much faster. 🙂 The only thing I’m struggling with is how to make the posts in the grid centered. I can get at them with some added CSS…

    .generate-columns-container .post {}

    But if I try something like margin:auto; it seems to conflict with other css and doesn’t have the effect of centering the posts in their columns.

    Let me know if you have any suggestions.

    Thanks, Tom! The site is already looking much better. 🙂

    #795671
    Tom
    Lead Developer
    Lead Developer

    Not too sure what you mean by centered. The content inside each post? Or the columns themselves?

    Let me know 🙂

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