Language versions of slider

Home Forums Spacious Pro Language versions of slider

Tagged: ,

This topic contains 15 replies, has 5 voices, and was last updated by  Sanjip Shah 3 years, 6 months ago.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #2515

    Jennica
    Participant

    Hi,

    I wonder if there is any possibility of having two different versions of the slider?

    I am using the Ceceppa Multilingua plugin to manage two language versions and it is working quite alright with the Spacious Pro theme. However, I cannot find any way to translate the text content of the slider. I know you have stated that you do not provide support when it comes to 3rd party plugins, which is understandable, but hopefully I can get some guidance still. The developer of the plugin suggests “You can see if your theme allow shortcode in slider fields”. So my question is, does it? Or do you have any other suggestions as to how I can get further to solve this?

    Much grateful for your input!

    Jennica

    #2562

    Sanjip Shah
    Moderator

    Hi,

    If rendering the shortcode in the slider helps you then try the following.

    It will need some code customization, open the theme folder->inc folder->header-functions.php file. Find the following code in lines around 197

    <?php if( !empty( $spacious_slider_title ) || !empty( $spacious_slider_text ) ) { ?>
    								<div class="entry-description-container">
    									<div class="slider-title-head"><h3 class="entry-title"><a href="<?php echo esc_url( $spacious_slider_link ); ?>" title="<?php echo esc_attr( $spacious_slider_title ); ?>"><span><?php echo $spacious_slider_title; ?></span></a></h3></div>
    									<div class="entry-content"><p><?php echo $spacious_slider_text; ?></p></div>
    								</div>
    								<?php } ?>
    								<div class="clearfix"></div>
    								<?php if( !empty( $spacious_slider_button_text ) ) { ?>
    								<a class="slider-read-more-button" href="<?php echo esc_url( $spacious_slider_link ); ?>" title="<?php echo esc_attr( $spacious_slider_title ); ?>"><?php echo $spacious_slider_button_text; ?></a>
    								<?php } ?>

    And replace with following.

    <?php if( !empty( $spacious_slider_title ) || !empty( $spacious_slider_text ) ) { ?>
    								<div class="entry-description-container">
    									<div class="slider-title-head"><h3 class="entry-title"><a href="<?php echo esc_url( $spacious_slider_link ); ?>" title="<?php echo esc_attr( $spacious_slider_title ); ?>"><span><?php echo do_shortcode( $spacious_slider_title ); ?></span></a></h3></div>
    									<div class="entry-content"><p><?php echo do_shortcode( $spacious_slider_text ); ?></p></div>
    								</div>
    								<?php } ?>
    								<div class="clearfix"></div>
    								<?php if( !empty( $spacious_slider_button_text ) ) { ?>
    								<a class="slider-read-more-button" href="<?php echo esc_url( $spacious_slider_link ); ?>" title="<?php echo esc_attr( $spacious_slider_title ); ?>"><?php echo do_shortcode( $spacious_slider_button_text ); ?></a>
    								<?php } ?>

    Note: For any changes directly to the theme file, make child theme for the customization so that you don’t lose the changes when you update the theme.

    Hope this helps. Also, we are thinking of making this theme compatible with WPML premium plugin in our version updates, so that our users can have site in multiple langage at the same time, but this can take some time.

    #2891

    diogomfguilherme
    Participant

    Hi Sanjip,

    I am looking for this also but I cannot find this code, I found partially but not all. I am using the Spacious Free theme.

    Could you take a look and let me know?

    Best Regards,

    DG

    #2934

    Sanjip Shah
    Moderator

    Hi DG,

    It is in lines around 96 in the same file theme folder->inc folder->header-functions.php in the free version. Also, I will suggest to put your question https://themegrill.com/support-forum/forum/spacious-free/ for the Spacious Free theme so that we can keep questions organized with respect to the themes. Thanks.

    #3365

    Jennica
    Participant

    Hi,
    thank you for that valuable help! Being a newbie, I would not have thought of making a child theme so thanks a bunch for that remark as well. Your plans of making the theme ready for set up in multiple languages sounds like a great idea. Would make a very useful and beautiful theme even more useful. 🙂

    Although the above explained steps was almost peanuts, I can’t get the result I am looking for. I tried to use the shortcode in slider fields, I went in under Appearance – Theme Options – Slider and then wrote [_en_]English text[/_en_][_sv_]Swedish text[/_in_]. It came out looking exactly like that. Not as two different versions depending on the chosen language, as I hoped for.

    Guess I am making some really silly sort of error, would be very happy to get some more guidance on this.

    Jennica Månsson

    #3419

    Sanjip Shah
    Moderator

    Hi,

    I have changed the code and I tested it and the shortcode seems to be working fine. About the shortcode that you have added, can you recheck on it
    [_en_]English text[/_en_][_sv_]Swedish text[/_in_]
    Should not it be something lik [_en_]English text[/_en_][_sv_]Swedish text[/_sv_]

    #3428

    Jennica
    Participant

    I tried changing the shortcode but still same result.

    If it’s ok, I would like to illustrate what I am doing and what it looks like, to rule out I am not totally off?

    This is what I type in: Shortcode in slider field

    This is the result… Textbox in live slider

    Again, a great thank u

    Jennica

    #3475

    Sanjip Shah
    Moderator

    Hi,

    Yes, I can see the shortcode not rendering in the image that you provided. We have provided the help that we could. May be you will need to hire a developer to sort this out.

    #3595

    Jennica
    Participant

    Ok, so at least I know it is not me trying something impossible. It is “supposed” to work then. Thank you for your help this far!

    #3795

    miguelmclara
    Participant

    Is this still valid?

    I’ve created a child theme and wan to add language support to the slider… so if I simply replace the function in my child’s theme function, would this worK?

    #3798

    miguelmclara
    Participant

    It seems to be to be line 97 not 197 btw..

    #3857

    Sanjip Shah
    Moderator

    @miguelmclara Yes, you can copy the same function spacious_featured_image_slider in the child theme functions.php file and make the changes there.

    #5062

    miguelmclara
    Participant

    Thanks for the reply but the cahnge you propose is not compatible with polylang I’m affraid, I’ve posted in another similar topic a and easy solution for both polylang and WPML involving not php code at all!

    See here: https://themegrill.com/support-forum/topic/slider-description-entry-content/

    #5281

    Sanjip Shah
    Moderator

    Okay. Great!

    #1201121

    sander.apperloo
    Participant

    Hi,

    Is the solution mentioned above still working?
    i work with Polylang for different languages
    but with spacious slider, the button translated ok with the nl_nl.po file
    but the title text & slider description i can not translate?

    so i dont know if this woudl work?: [_en_]English text[/_en_][_nl_]Dutch text[/_nl_]

    hope you can help,
    because this is a show stopper for ussing Spacious Slider.

    thanks,
    cheers,
    Sander

Viewing 15 posts - 1 through 15 (of 16 total)

The topic ‘Language versions of slider’ is closed to new replies.