- This topic has 14 replies, 2 voices, and was last updated 1 year, 6 months ago by
David.
-
AuthorPosts
-
December 10, 2020 at 3:57 pm #1575033
sirlouen
How can I show the same layout as in archive/index for a list of WP_query’d blog posts in a different part of the site?
I’ve noticed that by using the default “content” template part as suggested by function generate_do_template_part it is not shown the same way. For example: the featured images are not even shown in “content.php”
What I’m missing? Where are the template parts actually are in Generatepress?
December 11, 2020 at 3:04 am #1575686sirlouen
I think I’ve found the issue:
generate_post_image is hooked to generate_after_entry_header with the conditional
not “is_singular” and not “is_404”, which means that replicating this content template won’t work either for 404 or post/pagesDefault imported theme blog structure doesn’t seem to be meant to be replicated outside archives/blog pages unfortunately, which is a drawback because it looks pretty cool
I’ve tried Tom’s WP Show Posts short code but the look is not that awesome…
WP Show Posts 3 column structure:
LH Consulting’s Broadcast GP template content 3 column structure:
PS: Probably with WPSP Pro I could do the trick… but hoped I could replicate it via code/templating.
December 11, 2020 at 3:44 am #1575747David
StaffCustomer SupportHi there,
when you say in a different part of your site – is this a separate Archive page or within the content of a page/post ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 11, 2020 at 3:45 am #1575753sirlouen
Within the content of a page/post
December 11, 2020 at 4:02 am #1575786David
StaffCustomer SupportIn that case i would recommend the WPSP plugin – the Pro version has more styling controls, and a fancy card feature:
https://demos.wpshowposts.com/cards/
Or i am more than happy to provide you some CSS to make the free version match your existing site styles
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 11, 2020 at 5:01 am #1575871sirlouen
Yes I was thinking that WSPS Pro could make this happen (for example, that featured post in the first position), but I don’t want to invest more atm.
In fact, I see that most of this blog functionality and styling is provided by Blog premium module, not generatepress itself and profiled by LH Consulting’s Broadcast customization.
I think this is a dead end on my journey to copy/paste replication of the blog page inside a page.
December 11, 2020 at 6:23 am #1575995David
StaffCustomer SupportAs i said i am happy to provide some CSS to style the WPSP Free version to match. If you want to set up a test page with the WPSP in place and share me a link ill take a look.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 12, 2020 at 7:46 am #1577533sirlouen
Ok David, here I provide you the access data
Main static page with blog posts based on WSPS: https://demo.ponoi.me/
Blog posts based on LH Consulting’s Broadcast template: https://demo.ponoi.me/blog/Looking forward to hearing from you
RegardsDecember 13, 2020 at 4:24 am #1578344David
StaffCustomer SupportLets do some future proofing first. By adding a Wrapper around the WPSP post content. This way if you want to add more content to the Post eg. excerpt, terms etc. they will keep the card styling.
To do this you need to create 2 x Hook Elements:https://docs.generatepress.com/article/hooks-element-overview/
First Hook
Title: WPSP Open Content Wrapper
Content:<div class="wpsp-content-wrap"> <!-- Openeing wrapper -->
Note: when you add the HTML to the hook it will auto add a
</div>
– you must delete that.
Hook: Custom Hook –> Enter in the field provided:wpsp_before_header
Priority:15
Display Rules:Entire Site
Second Hook
Title: WPSP Close Content Wrapper
Content:<!-- Close WPSP Wrapper --> </div>
Hook: Custom Hook –> Enter in the field provided:
wpsp_after_content
Priority:15
Display Rules:Entire Site
Let me know once thats setup so i can then work on the CSS.
If you want to display the Read More button, can you enable that in your WPSP list.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 13, 2020 at 4:28 am #1578347sirlouen
Hello David
Done, two hooks and Read More button includedDecember 13, 2020 at 6:53 am #1578653David
StaffCustomer SupportNow add this CSS:
/* post card style */ .wp-show-posts-columns .wp-show-posts-inner { display: flex; flex-direction: column; border-radius: 3px; transition: all 0.2s ease-in; transform: scale(1); box-shadow: 0px 0px 0px 1px rgba(214,218,222,1); } .wpsp-content-wrap { padding: 0 30px 20px; background-color: #fff; flex: 1; display: flex; flex-direction: column; } /* Heading style */ .wp-show-posts-entry-title a, .wp-show-posts-entry-title a:hover { color: #00253e; } /* Button Styling */ .wpsp-read-more { display: block; text-align: center; margin-top: auto; } a.wp-show-posts-read-more, a.wp-show-posts-read-more:visited, a.wp-show-posts-read-more, a.wp-show-posts-read-more:hover { color: #00a390; background-color: #ffffff; font-size: 17px; line-height: 1.5em; padding: 10px 20px; border-width: 1px; border-style: solid; border-color: inherit; border-radius: 3px; } a.wp-show-posts-read-more:hover { color: #000; } /* Hover effects desktop only */ @media (min-width: 769px) { .wpsp-read-more { opacity: 0; transition: all 0.3s ease-in-out; } .wp-show-posts-inner:hover .wpsp-read-more { opacity: 1; } .wp-show-posts-columns .wp-show-posts-inner:hover { transform: scale(1.01); box-shadow: 0px 5px 10px 0px rgba(0,0,0,0.3); } .wp-show-posts-single.post:first-child { width: 66.666% } }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 15, 2020 at 12:52 pm #1582032sirlouen
Nice CSS, for some reason I did not receive the notification from the last update 🙁
How would you make the first element more prominent compared to the others like in the LH Consulting’s Broadcast customizationDecember 16, 2020 at 1:20 am #1582529David
StaffCustomer SupportJust updated the CSS above to include that 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 16, 2020 at 7:24 am #1583080sirlouen
Looks great.
I think this does the trick.
Thanks for the support.December 16, 2020 at 8:01 am #1583151David
StaffCustomer SupportGlad to be of help!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.