Tagged: x
-
AuthorPosts
-
December 1, 2016 at 3:17 pm #1277928
Karl KParticipantHi there,
I’m currently displaying recent posts below post content using the following code in my functions.php file:
function single_post_r_shortcode($contents) { if(is_singular()) $contents .= do_shortcode('<h3>More From Guys Drinking Beer</h3>[ess_grid alias="recent"]'); return $contents; }Is there a way to hide this from our woocommerce product pages? Here’s an example: http://www.guysdrinkingbeer.com/product/homebrewers-almanac
Thanks,
Karl
December 1, 2016 at 6:40 pm #1278093
FriechModeratorHi Karl,
Thanks for writing in! Are you referring to the More From Guys Drinking Beer section? If so, you can add this under Custom > CSS in the Customizer.
.single-product .x-tab-content .description_pane .myportfolio-container, .single-product .x-tab-content .description_pane h3 { display: none; }Hope it helps, Cheers!
December 2, 2016 at 9:20 am #1278845
Karl KParticipantThat did the trick! Thanks so much.
December 2, 2016 at 9:36 am #1278860
Karl KParticipantOne quick follow-up, is there also a way to exclude pages from displaying the “More From…” too?
December 2, 2016 at 10:26 am #1278905
RahulModeratorHey There,
Thanks for writing back!
Can you explain it a bit more so that we can give you a proper solution to it?
Thanks for understanding!
December 2, 2016 at 10:36 am #1278917
Karl KParticipantSure. Circling back up to the top of this thread, I am using the following code to display recent posts in an Essential Grid below post content.
function single_post_r_shortcode($contents) { if(is_singular()) $contents .= do_shortcode('<h3>More From Guys Drinking Beer</h3>[ess_grid alias="recent"]'); return $contents; }You can see an example at the bottom of this post: http://www.guysdrinkingbeer.com/the-green-lady-to-stop-selling-miller-products
Is there a way to have this grid appear on posts and not pages? I am designing a shop page for Woocommerce using Essential Grid and the recent posts look out of place at the bottom of that page.
Thanks.
December 2, 2016 at 3:34 pm #1279228
FriechModeratorHi There,
Please update your code to this:
function single_post_r_shortcode($contents) { if(is_singular('post')) $contents .= do_shortcode('<h3>More From Guys Drinking Beer</h3>[ess_grid alias="recent"]'); return $contents; }That should make the code apply only on the single post, not on products, nor pages.
Hope it helps, Cheers!
December 2, 2016 at 4:05 pm #1279253
Karl KParticipantWorked like a charm. Thanks for pulling through again.
December 2, 2016 at 8:40 pm #1279489
FriechModeratorWe’re delighted to assist you with this.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1277928 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
