-
AuthorPosts
-
June 23, 2021 at 10:12 pm #1307210
Hi,
I added the code below for a layersilider to be shown at the very top of the woocommerce category page based on the category ID. It is working without any problem. Child category styling is default and the description is empty. I tried this on local and hasn’t added the code for the actual live site yet. Just trying..
Is this a good practice? I do not know. What do you think? If anyone who has Enfold theme and is using similar coding, can respond this topic, that would be insightful.
add_action( 'woocommerce_before_main_content', 'just_the_slider', 0 ); function just_the_slider(){ if( is_product_category( array( 271 ) ) ) { echo do_shortcode('[layerslider id="32"]'); } }
Thanks
June 24, 2021 at 9:30 am #1307260Hi ilkbaharkunduzu,
Thanks for posting your solution.
If you’re using a child theme and added this code in your child theme’s functions.php, I believe you’re doing a great job.Best regards,
NikkoSeptember 3, 2021 at 5:02 pm #1319672Hi,
I use the same theme for this account ( I am the same guy this is the account of my friend I made him buy this theme ) but when I add this code I only see [layerslider id=”2″] in the category page. I echo as it is but it does not show the layer slider. What could be the reason?
In that account ( ilkbaharkunduzu) I have a layer slider license from codecanyon. But in this account I only use default layer slider that comes with the theme. Could that be the reason? Should he buy a layer slider license for that?
Thanks
September 6, 2021 at 7:47 pm #1319896Hi samkamakina,
I apologize for the delayed response.
And as for your question, I don’t think the license was the issue why the layerslider is not showing, however, can you give us temporary admin access? so we can check the backend and try to see why it’s not showing as you have mentioned. Just post the credentials in private content.Best regards,
NikkoSeptember 6, 2021 at 8:10 pm #1319906Hi,
In the child theme I added the code like this. When I added the code like this I just see [layerslider id=”2″] as a text in the category page under the menu. I added the link of that page.
add_action( 'woocommerce_before_main_content', 'just_the_slider', 0 ); function just_the_slider(){ if( is_product_category( array( 37 ) ) ) { echo do_shortcode('[layerslider id="2"]'); } }
The site is not open yet. My friend is kind of studying woocommerce. In a learning phase….
Note: Something is also weird. When I change [layerslider id=”2″] to [av_layerslider id=”2″] ( that comes from one of your topics…) I see just an empty shell with a true height. However, it is just empty.
Best Regards
- This reply was modified 3 years, 2 months ago by samkamakina.
September 7, 2021 at 7:11 pm #1320010Hi samkamakina,
Thanks, the correct code is [av_layerslider id=”2″] however I do apologize for my incorrect answer and you are correct that he needs the license as Ismael mentioned in this thread: https://kriesi.at/support/topic/layerslide-on-product-category/#post-728829
The dirty code mentioned in the thread doesn’t work anymore unfortunately.Best regards,
NikkoSeptember 7, 2021 at 11:39 pm #1320027Hi,
Thanks. I added the plugin to try it. Yes. He should buy that if it is needed in the category pages. However, I hope you actually add the option for category pages’ admin side for layer slider or slider revolution..
Best Regards
September 10, 2021 at 6:51 pm #1320439Hi samkamakina,
We’ll forward your request :)
Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.