- This topic has 12 replies, 3 voices, and was last updated 6 years, 7 months ago by
Tom.
-
AuthorPosts
-
January 22, 2019 at 2:39 pm #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!
January 22, 2019 at 6:22 pm #789554Leo
StaffCustomer SupportHi 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-pageI’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 🙂
January 22, 2019 at 7:40 pm #789585Christopher
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!
January 22, 2019 at 8:14 pm #789609Christopher
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…
January 23, 2019 at 7:50 am #790113Tom
Lead DeveloperLead Developerbut 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?
January 23, 2019 at 2:02 pm #790421Christopher
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.
January 23, 2019 at 5:25 pm #790547Tom
Lead DeveloperLead DeveloperTry turning columns off inside the GPP settings: Customize > Layout > Blog
January 23, 2019 at 5:27 pm #790549Christopher
You’re brilliant. Thank you!
January 23, 2019 at 5:29 pm #790553Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
January 28, 2019 at 4:18 pm #794959Christopher
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.
January 28, 2019 at 5:19 pm #794997Tom
Lead DeveloperLead DeveloperGood call 🙂
Thanks for the update!
January 28, 2019 at 10:32 pm #795108Christopher
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. 🙂
January 29, 2019 at 8:16 am #795671Tom
Lead DeveloperLead DeveloperNot too sure what you mean by centered. The content inside each post? Or the columns themselves?
Let me know 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.