Tagged: category page, custom, enfold, woocommerce
-
AuthorPosts
-
November 3, 2016 at 5:42 pm #707882
Hi I have a question. I would like that all the woocommerce archive pages (i.e. the pages that appear if I filter a specific category from the woo product categories widget) do show, before the archive content, some element that I created for the shop page designed with avia layout builder elements.
These elements are basically a wp-layout slider and a section with five columns containing some icons. These elements should appear always before the woocommerce content (the products filtered for the specific category).I checked out and found that the woocommerce page is the archive-product page. Actually if I write anything in that page (duplicated in my child-theme) between
<?php /** * woocommerce_before_main_content hook. * * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) * @hooked woocommerce_breadcrumb - 20 */ do_action( 'woocommerce_before_main_content' ); ?>
and
<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?> <h1 class="page-title"><?php woocommerce_page_title(); ?></h1> <?php endif; ?>
it appears exactly where I want.
However I wonder I could insert the following avia shortcodes and make them appearing properly:
[av_layerslider id='6'] [av_section min_height='25' min_height_px='500px' padding='default' shadow='no-shadow' bottom_border='no-border-styling' bottom_border_diagonal_color='#333333' bottom_border_diagonal_direction='' bottom_border_style='' id='' color='main_color' custom_bg='#ec9b84' src='' attachment='' attachment_size='' attach='scroll' position='top left' repeat='no-repeat' video='' video_ratio='16:9' overlay_opacity='0.5' overlay_color='' overlay_pattern='' overlay_custom_pattern='' custom_class=''] [av_one_fifth first min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue806' font='entypo-fontello' style='border' caption='Lista dei desideri <br/> WISHLIST' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth][av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue859' font='entypo-fontello' style='border' caption='ACQUISTO <br/> facile e veloce' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth][av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue802' font='fontello' style='border' caption='PAGAMENTO SICURO <br/> con Bonifico e PAYPAL' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth][av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue804' font='fontello' style='border' caption='SPEDIZIONE <br/>24/48 ore' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth][av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue803' font='fontello' style='border' caption='Rimborso di denaro ad ogni acquisto' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth] [/av_section]
Thanks for helping
November 5, 2016 at 9:41 am #708631Hey Elena,
Try to place your shortcode inside this code:
<?php echo do_shortcode("SHORTCODE_REPLACE"); ?>
replace the SHORTCODE_REPLACE to your shorcode and place it in-between the lines of codes you have posted. Hope this helps :)
Best regards,
NikkoNovember 7, 2016 at 9:04 am #709072Hi Nikko,
thanks for the suggestion. The shortcode now is read, but the layout is all messy. Do you have any suggestion?
You can find the site at the following address:
I would like that archive-pages get the same layout of the shop page (http://www.vincenzaboutique.it/negozio/), with the layer slider and the section with the pictograms.
If I paste my shortcodes in the archive-page.php it mess up everything. I tried also to check in the enfold/woocommerce/config.php if I could copy and modify the action woocommerce_before_main_content, but It comes always with the same problem.
I really appreciate your help
- This reply was modified 8 years, 1 month ago by elenapoliti.
November 8, 2016 at 8:57 am #709649Hi Elena,
Can you also provide us with ftp details of your site? it’s a bit risky to edit php files in wordpress’ theme editor. Also just to confirm the shortcode you posted above results in the slider with girl in glasses and 5 icons below it?
Best regards,
NikkoNovember 8, 2016 at 10:28 am #709682Hi Nikko the ftp access is given in the private section.
Yes the idea is to have the wp layer slider [layer-slider-6] and the section with five pictograms over every page that is generated by the archive-page.php, in the same manner of the main shop page.
I could work on shop layout as Enfold gives me the possibility to do it. However I would like that also by selecting a category or subcategory from the left sidebar the page appears in the same manner.
Thanks very much
November 10, 2016 at 7:45 am #710560Hey!
We added a “dirty” solution in the functions.php file:
add_action('woocommerce_before_main_content', 'ava_woocommerce_before_main_content'); function ava_woocommerce_before_main_content() { if(!is_tax('product_cat')) return; $resources = '<link rel="stylesheet" id="layerslider-css" href="http://www.vincenzaboutique.it/wp-content/themes/enfold/config-layerslider/LayerSlider/static/css/layerslider.css?ver=5.6.8" type="text/css" media="all"> <script type="text/javascript" src="http://www.vincenzaboutique.it/wp-content/themes/enfold/config-layerslider/LayerSlider/static/js/greensock.js?ver=1.11.8"></script> <script type="text/javascript" src="http://www.vincenzaboutique.it/wp-content/themes/enfold/config-layerslider/LayerSlider/static/js/layerslider.transitions.js"></script> <script type="text/javascript" src="http://www.vincenzaboutique.it/wp-content/themes/enfold/config-layerslider/LayerSlider/static/js/layerslider.kreaturamedia.jquery.js?ver=5.6.8"></script>'; $script = "<script data-cfasync=\"false\" type=\"text/javascript\"> lsjQuery(document).ready(function() { if(typeof lsjQuery.fn.layerSlider == \"undefined\") { lsShowNotice('layerslider_6','jquery'); } else { lsjQuery(\"#layerslider_6\").layerSlider({responsiveUnder: 1140, layersContainer: 1140, autoStart: false, startInViewport: false, pauseOnHover: false, firstSlide: 'random', twoWaySlideshow: true, loops: 1, keybNav: false, touchNav: false, skin: 'fullwidth', navPrevNext: false, hoverPrevNext: false, navStartStop: false, navButtons: false, showCircleTimer: false, thumbnailNavigation: 'disabled', lazyLoad: false, yourLogoStyle: 'left: 10px; top: 10px;', cbInit: function(element) { }, cbStart: function(data) { }, cbStop: function(data) { }, cbPause: function(data) { }, cbAnimStart: function(data) { }, cbAnimStop: function(data) { }, cbPrev: function(data) { }, cbNext: function(data) { }, skinsPath: 'http://www.vincenzaboutique.it/wp-content/themes/enfold/config-layerslider/LayerSlider/static/skins/'}) } }); </script>"; $output = $resources . '<div id="layer_slider_1" class="avia-layerslider main_color avia-shadow avia-builder-el-0 el_before_av_section avia-builder-el-first container_wrap sidebar_left" style="height: auto;">'.$script.'<div class="ls-wp-fullwidth-container" style="height: 282px;"><div class="ls-wp-fullwidth-helper" style="width: 919px; height: 282px; left: 0px;"><div id="layerslider_6" class="ls-wp-container ls-container ls-fullwidth" style="width: 919px; height: 282.149px; margin: 0px auto; visibility: visible;"><div class="ls-inner" style="background-color: transparent; width: 919px; height: 282px;"><div class="ls-slide ls-slide-1" data-ls=" transition2d: all;" style="width: 919px; height: 282px;"><img src="http://www.vincenzaboutique.it/wp-content/uploads/2016/11/slider-vincenza-boutique-wishlist.jpg" class="ls-bg" alt="slider-vincenza-boutique-wishlist"><div class="ls-gpuhack"></div></div><div class="ls-slide ls-slide-2" data-ls=" transition2d: all;" style="width: 919px; height: 282px;"><img src="http://www.vincenzaboutique.it/wp-content/uploads/2016/11/slider-vincenza-boutique-shop.jpg" class="ls-bg" alt="slider-vincenza-boutique-shop"><div class="ls-gpuhack"></div></div><div class="ls-slide ls-slide-3" data-ls=" transition2d: all;" style="width: 919px; height: 282px;"><img src="http://www.vincenzaboutique.it/wp-content/uploads/2016/11/slider-vincenza-boutique-3.jpg" class="ls-bg" alt="slider-vincenza-boutique-3"><div class="ls-gpuhack"></div></div><div class="ls-slide ls-slide-4" data-ls=" transition2d: all;" style="width: 919px; height: 282px; left: 0px; right: auto; top: 0px; bottom: auto;"><img src="http://www.vincenzaboutique.it/wp-content/uploads/2016/11/slider-vincenza-boutique-4.jpg" class="ls-bg" alt="slider-vincenza-boutique-4"><div class="ls-gpuhack"></div></div><div class="ls-slide ls-slide-5 ls-active" data-ls=" transition2d: all;" style="width: 919px; height: 282px; visibility: visible; display: none; left: auto; right: 0px; top: 0px; bottom: auto;"><img src="http://www.vincenzaboutique.it/wp-content/uploads/2016/11/slider-vincenza-boutique-5.jpg" class="ls-bg ls-preloaded" alt="slider-vincenza-boutique-5" style="padding: 0px; border-width: 0px; width: 806.14px; height: 174.932px; margin-left: 56.4298px; margin-top: 53.5338px;"><div class="ls-gpuhack" style="width: auto; height: auto; padding: 0px; border-width: 0px; left: 0px; top: 0px;"></div></div><div class="ls-slide ls-slide-6" data-ls=" transition2d: all;" style="width: 919px; height: 282px;"><img src="http://www.vincenzaboutique.it/wp-content/uploads/2016/11/slider-vincenza-boutique-6.jpg" class="ls-bg" alt="slider-vincenza-boutique-6"><div class="ls-gpuhack"></div></div></div><div class="ls-loading-container" style="z-index: -1; display: none;"><div class="ls-loading-indicator"></div></div><div class="ls-shadow"></div></div></div></div></div>'; echo $output; $columns = do_shortcode("[av_one_fifth first min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue806' font='entypo-fontello' style='border' caption='Lista dei desideri <br/> WISHLIST' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth][av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue859' font='entypo-fontello' style='border' caption='ACQUISTO <br/> facile e veloce' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth][av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue802' font='fontello' style='border' caption='PAGAMENTO SICURO <br/> con Bonifico e PAYPAL' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth][av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue804' font='fontello' style='border' caption='SPEDIZIONE <br/>24/48 ore' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth][av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''] [av_font_icon icon='ue803' font='fontello' style='border' caption='Rimborso di denaro ad ogni acquisto' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon] [/av_one_fifth]"); echo '<div id="av_section_1" class="avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll avia-builder-el-1 el_after_av_layerslider el_before_av_productgrid av-minimum-height av-minimum-height-25 container_wrap sidebar_left" style="background-color: #ec9b84; background-color: #ec9b84; "><div class="container"><div class="template-page content av-content-small units"><div class="post-entry post-entry-type-page post-entry-16"><div class="entry-content-wrapper clearfix">'.$columns.'</div><!-- close content main div --></div></div></div></div>'; }
// http://www.vincenzaboutique.it/categoria-prodotto/abbigliamento/collezione/
Cheers!
IsmaelNovember 10, 2016 at 8:30 am #710572Hi Elena,
I checked the code you used and I replaced it with this one:
add_action('woocommerce_before_main_content', 'ava_woocommerce_before_main_content', 5); function ava_woocommerce_before_main_content() { if(!is_tax('product_cat')) return; $resources = "<link rel='stylesheet' id='layerslider-css' href='" . get_template_directory_uri() . "/config-layerslider/LayerSlider/static/css/layerslider.css?ver=5.6.2' type='text/css' media='all' /> <script type='text/javascript' src='" . get_template_directory_uri() . "/config-layerslider/LayerSlider/static/js/greensock.js?ver=1.11.8'></script> <script type='text/javascript' src='" . get_template_directory_uri() . "/config-layerslider/LayerSlider/static/js/layerslider.kreaturamedia.jquery.js?ver=5.6.2'></script> <script type='text/javascript' src='" . get_template_directory_uri() . "/config-layerslider/LayerSlider/static/js/layerslider.transitions.js?ver=5.6.2'></script>"; $script = "<script data-cfasync=\"false\" type=\"text/javascript\">var lsjQuery = jQuery;</script><script data-cfasync=\"false\" type=\"text/javascript\"> lsjQuery(document).ready(function() { if(typeof lsjQuery.fn.layerSlider == \"undefined\") { lsShowNotice('layerslider_6','jquery'); } else { lsjQuery(\"#layerslider_6\").layerSlider({responsiveUnder: 1140, layersContainer: 1140, autoStart: false, startInViewport: false, pauseOnHover: false, twoWaySlideshow: true, loops: 1, keybNav: false, touchNav: false, skin: 'fullwidth', globalBGColor: 'rgba(255, 255, 255, 0.45)', navPrevNext: false, hoverPrevNext: false, navStartStop: false, navButtons: false, showCircleTimer: false, thumbnailNavigation: 'disabled', lazyLoad: false, yourLogoStyle: 'left: 10px; top: 10px;', cbInit: function(element) { }, cbStart: function(data) { }, cbStop: function(data) { }, cbPause: function(data) { }, cbAnimStart: function(data) { }, cbAnimStop: function(data) { }, cbPrev: function(data) { }, cbNext: function(data) { }, skinsPath: 'http://www.saldaturacontrollo.it/wp/wp-content/themes/enfold/config-layerslider/LayerSlider/static/skins/'}) } }); </script>"; $output = $resources . $script; echo $output; echo do_shortcode("[av_layerslider id='6']"); ?> <div id="av_section_1" class="avia-section main_color avia-section-default avia-no-shadow avia-bg-style-scroll avia-section av-minimum-height av-minimum-height-25 container_wrap sidebar_left" style="background-color: #ec9b84; background-color: #ec9b84; "> <div class="container"> <div class="template-page content av-content-small units"> <div class="post-entry post-entry-type-page post-entry-417"> <div class="entry-content-wrapper clearfix"> <?php echo do_shortcode("[av_one_fifth first min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''][av_font_icon icon='ue806' font='entypo-fontello' style='border' caption='Lista dei desideri <br/> WISHLIST' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon][/av_one_fifth] [av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''][av_font_icon icon='ue859' font='entypo-fontello' style='border' caption='ACQUISTO <br/> facile e veloce' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon][/av_one_fifth] [av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''][av_font_icon icon='ue802' font='fontello' style='border' caption='PAGAMENTO SICURO <br/> con Bonifico e PAYPAL' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon][/av_one_fifth] [av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''][av_font_icon icon='ue804' font='fontello' style='border' caption='SPEDIZIONE <br/>24/48 ore' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon][/av_one_fifth] [av_one_fifth min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_display=''][av_font_icon icon='ue803' font='fontello' style='border' caption='Rimborso di denaro ad ogni acquisto' link='manually,http://' linktarget='' size='40px' position='center' color='#b02b2c' custom_class=''][/av_font_icon][/av_one_fifth]"); ?> </div> </div> </div> </div> </div> <?php }
Color Section shortcode causes it to break, so I created the
<div>s, as for the layerslider, it doesn’t seem to work, I even fixed the script code and changed localhost which causes 404 error, for the layerslider part, can you use image instead? as I really tried to make the layerslider work but unfortunately I already spent a lot of time. Hope this helps :)Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.