Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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

    #1307260

    Hi 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,
    Nikko

    #1319672

    Hi,

    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

    #1319896

    Hi 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,
    Nikko

    #1319906

    Hi,

    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, 3 months ago by samkamakina.
    #1320010

    Hi 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,
    Nikko

    #1320027

    Hi,

    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

    #1320439

    Hi samkamakina,

    We’ll forward your request :)

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.