-
AuthorPosts
-
October 15, 2015 at 12:14 pm #519189
Hi
I want to add text (specifically BreadCrumbs) to the top of every product page here …
http://dev2.electrixinternational.com/product/flat-lid-trunking-length/
http://screencast.com/t/ESr1vgqCiHOctober 15, 2015 at 6:06 pm #519468Hi richardelectrix!
Try adding this to the bottom of your functions.php file.
add_action( 'woocommerce_before_single_product_summary', 'enfold_customization_woocommerce_extra_text', 1); function enfold_customization_woocommerce_extra_text(){ echo 'your text goes here'; }
Regards,
ElliottOctober 16, 2015 at 9:26 am #519729So with this one in the your text goes here bt, could I use this?
[av_textblock size='' font_color='' color='' custom_class='bread-crumb'] [bread_crumb] [/av_textblock]
October 16, 2015 at 1:16 pm #519902Hey!
If you would like to add breadcrumbs, why do not you edit your product and simply choose to display breadcrumbs?
Regards,
YigitOctober 16, 2015 at 1:32 pm #519919Hi
How do I do that?
October 16, 2015 at 1:37 pm #519928Hi!
Please edit your product and under Layout section, in Title Bar Settings choose to display them – http://i.imgur.com/2DTg8oP.png
Best regards,
YigitOctober 16, 2015 at 1:42 pm #519935Hi
That option is only enabled if I choose Advanced Layout Editor.
If I switch on Advanced Layout Editor my design of the product page disappears fully.
Therefore I would have to redesign all of my product pages and enable the breadcrumbs – hence I was hoping for an easier solution.
October 16, 2015 at 1:45 pm #519940Hey!
No, it does appear automatically on my local installation without choosing to use Advanced Layout Builder. Can you please edit your product and post a screenshot of the whole screen?
Regards,
YigitOctober 19, 2015 at 11:29 am #520828October 19, 2015 at 11:31 am #520829Ah I see what has happened. It only applies to the top section.
My mistake.
The breadcrumbs now appear, but they are in the wrong font colour and the wrong position …
October 19, 2015 at 11:37 am #520830add_action( 'woocommerce_before_single_product_summary', 'enfold_customization_woocommerce_extra_text', 1); function enfold_customization_woocommerce_extra_text(){ echo 'your text goes here'; }
I have tried the code above to do something different, but I want it to display where my breadcrumbs display rather that directly above the product title …
October 19, 2015 at 11:46 am #520833Hey!
Can you please post a screenshot and show the changes you would like to make? If it is breadcrumbs that you would like to show and make changes on, please enable them as well
Cheers!
YigitOctober 19, 2015 at 12:03 pm #520844Hi
On our previous site we were using this code
<p id="breadcrumbs" style="padding-top:0px; padding-bottom:20px;"><a href="/">Home</a> >> <a href="/products">Products</a> >> <strong><?php echo get_the_title( $ID ); ?></strong></p>
We cannot use standard breadcrumbs as with products it takes you back to a product category page, but we dont want users to be able to go to that page because we can’t promote the products on it. Which is why we have used Pages for the product category pages.
The above works to a point except the …
<?php echo get_the_title( $ID ); ?>
… bit which doesnt display.
The current code in my CSS looks like this …
/* CT START Manual Breadcrumbs */ add_action( 'woocommerce_before_single_product_summary', 'enfold_customization_woocommerce_extra_text', 1); function enfold_customization_woocommerce_extra_text(){ echo '<p id="breadcrumbs" style="padding-top:0px; padding-bottom:20px;">You are here: <a href="/">Home</a> / <a href="/products">Products</a> / <strong></strong></p>'; echo '<?php echo get_the_title( $ID ); ?>'; } /* CT END Manual Breadcrumbs */
October 27, 2015 at 5:56 pm #525697Hey!
So what your actually trying to do is hide the product categories in the breadcrumbs. Add this to your custom CSS.
#top .breadcrumb-trail > a, #top .breadcrumb-trail > .trail-before, #top .breadcrumb-trail > :nth-child(3), #top .breadcrumb-trail > :nth-last-child(1) { display: block !important; } .single-product .breadcrumb-trail > * { display: none !important; }
Best regards,
ElliottNovember 4, 2015 at 12:48 pm #529947Hi
That almost works but not quite.
I wanted it to be Home / Products / SKUTitle
The above just outputs Home /SKUTitle (with no space before the SKU Title.
I was extremely close with my previous code in Functions (which also meant that I didnt have to go through every product and turn on breadcrumbs), the only thing wrong with it was the SKUTitle was appear on a separate line to the You are here …… bit.
November 4, 2015 at 3:17 pm #530063Hi
This has been resolved in another thread.
Thanks
-
AuthorPosts
- The topic ‘Add text to the top of every product page’ is closed to new replies.