Slider Description displaying HTML

Home Forums Spacious Free Slider Description displaying HTML

This topic contains 14 replies, has 5 voices, and was last updated by  ashishsthanp 2 weeks, 4 days ago.

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

    apuchek
    Participant

    My slider contains HTML tags to integrate line breaks into my text in the slider description.

    I just updated to 1.2.1 and now the slider description is displaying all of my text as a single sentence and is now showing all my HTML <br> tags as standard text.

    Is there a fix for this? How can I get my line breaks back?

    #98926

    Bipin Singh
    Moderator

    Hi,

    In the new version we have used escaping in the description part of the slider as per Theme Review guildline. So, it will display only the text (not html).
    But if you want to use HTML tag than you can remove the escaping. Here’s how to do it.

    Create the child theme. Add the file functions.php and paste the following code:

    <?php 
    function spacious_featured_image_slider() {
    global $post;
    ?>
    <section id="featured-slider">
    	<div class="slider-cycle">
    		<?php
    for( $i = 1; $i <= 5; $i++ ) {
    	$spacious_slider_title = of_get_option( 'spacious_slider_title'.$i , '' );
    	$spacious_slider_text = of_get_option( 'spacious_slider_text'.$i , '' );
    	$spacious_slider_image = of_get_option( 'spacious_slider_image'.$i , '' );
    	$spacious_slider_button_text = of_get_option( 'spacious_slider_button_text'.$i , __( 'Read more', 'spacious' ) );
    	$spacious_slider_link = of_get_option( 'spacious_slider_link'.$i , '#' );
    	if( !empty( $spacious_header_title ) || !empty( $spacious_slider_text ) || !empty( $spacious_slider_image ) ) {
    		if ( $i == 1 ) { $classes = "slides displayblock"; } else { $classes = "slides displaynone"; }
    		?>
    <div class="<?php echo $classes; ?>">
    <figure>
    	<img alt="<?php echo esc_attr( $spacious_slider_title ); ?>" src="<?php echo esc_url($spacious_slider_image); ?>">
    </figure>
    <div class="entry-container">
    <?php if( !empty( $spacious_slider_title ) || !empty( $spacious_slider_text ) ) { ?>
    <div class="entry-description-container">
    	<?php if( !empty( $spacious_slider_title ) ) { ?>
    	<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 esc_html( $spacious_slider_title ); ?></span></a></h3></div>
    	<?php
    	}
    	if( !empty( $spacious_slider_text ) ) {
    		?>
    	<div class="entry-content"><p><?php echo $spacious_slider_text; ?></p></div>
    	<?php
    	}
    	?>
    </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 esc_html( $spacious_slider_button_text ); ?></a>
    <?php } ?>
    </div>
    </div>
    <?php
    }
    }
    ?>
    </div>
    <nav id="controllers" class="clearfix"></nav>
    </section>
    
    <?php
    }
    ?>

    Hope this helps.
    If you appreciate our work and want to return us a favor than please helps us by rating our theme in WordPress repo here: https://wordpress.org/support/view/theme-reviews/spacious

    #99001

    apuchek
    Participant

    Perfect, thanks! Fixed.

    #99043

    Bipin Singh
    Moderator

    That’s great.
    Feel free to contact us again if there are further query.

    Thank you for using and appreciating our theme.

    #1219572

    apuchek
    Participant

    Just updated to 1.3.5 and now I’m getting this error:
    Fatal error: Call to undefined function of_get_option() in D:\Hosting\8918243\html\wp-content\themes\spacious-child\functions.php on line 13

    Definitely an issue with my child theme from the fix you provided earlier. Thoughts?

    #1219625

    apuchek
    Participant
    #1219685

    Bishal Napit
    Moderator

    @apuchek

    If there are any further query, then, please feel free to post them. Thanks.

    #1344030

    design9
    Participant

    Hi,
    I’m using the FlashPro theme.

    How would I go about doing the same thing with that template?

    I would like to be able to have a line break in the description.

    I tried replacing “spacious” with “flash”, but that does not work.

    #1344102

    ashishsthanp
    Moderator

    Hi design9
    You can add HTML <br> where you want to have line break like this:

    One of the BEST WORDPRESS THEME <br>
    One of the BEST WORDPRESS THEME <br>
    One of the BEST WORDPRESS THEME

    Regards,
    ThemeGrill Support Team.

    #1344118

    design9
    Participant

    Thanks for you answer. This is the first thing I tried but that gets deleted completely after saving the page.

    That is why I came to this thread and tried the solution above.

    That solution however does not work with Flash Pro.

    Regards,

    Silvio

    #1344280

    ashishsthanp
    Moderator

    Hi,
    If you put <br> tag in slider description input area, it should break the line. Can you provide your site URL?

    #1344307

    design9
    Participant

    Hi,

    Thanks. Here is the site: http://staging.ingridzinnel.com

    This is the Description of the first slide: Ich freue mich, wenn Sie etwas Sinnvolles und Hilfreiches für Ihren Weg bei mir finden, Ingrid Zinnel

    I tried entering <br> or <br/> just before the name at the end.

    regards

    Silvio

    #1344478

    ashishsthanp
    Moderator

    Hi
    This feature will be added to next update of the theme.

    Flash Toolkit

    Thanks.

    #1344507

    design9
    Participant

    Hi
    Thanks. I don’t quite understand. This should have been fixed in the update from August last year and the last update is 4 months ago.

    1.1.4 – 2017-08-24

    Tweak – Allow HTML in Widget Textarea Fields
    Do you have any estimate when the next update would be?

    Best regards

    Silvio

    #1344635

    ashishsthanp
    Moderator

    Hi
    This issue has been fixed and will be available soon.

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

You must be logged in to reply to this topic.