Slider blank lines and to short text
Tagged: empty p tag, slider
- This topic has 7 replies, 3 voices, and was last updated 7 years, 3 months ago by Grace Themes.
-
AuthorPosts
-
May 27, 2016 at 8:55 am #1068Iztok JamnikParticipant
Hi,
I’ve installed a free version of your theme.
1. I’ve problem that before and after the text in a slider there is an empty line (empty p tag).
You can see it on http://www.zasluzim.si/.
2. On your demo page you have bold text in a first row in a slider. How can I do that?
3. The text in the second row (the content of the page) of a slider in my theme can be very short – see first slide on my page – this is the max number of characters that can be shown. How can I show more characters?
Thank you in advance
Iztok
June 2, 2016 at 3:44 pm #1117Grace ThemesMemberHi Iztok,
Please send WordPress admin login details of your website at [email protected]
so we can check your site and solve the problems.Regards
Grace ThemesMay 18, 2017 at 10:44 am #4478Andreas Ebbert-KarroumParticipantI have exactly the same problems, could you solve it?
May 18, 2017 at 12:03 pm #4481Grace ThemesMemberHi Andreas,
To remove the empty line before and after the slider description
Go to Appearance -> Editor -> header.php file
at line no. 69 you will find the below code
<p><?php echo wp_trim_words( get_the_content(), 20, '' ); ?></p>
just need to remove p tag like below
<?php echo wp_trim_words( get_the_content(), 20, '' ); ?>
Also to make the homepage slider auto rotate
Open js/jquery.nivo.slider.js file
at line no. 22 set stop: falsePlease do this changes and let me know your feedback.
If you find any difficulty please send WordPress admin login details of your website at [email protected] so we can check your site and solve the problems.
Regards
Grace Themes
https://gracethemes.comJune 19, 2017 at 12:01 pm #4789Andreas Ebbert-KarroumParticipantHi,
I don’t have the code that you mention, for me the line looks like this:
$content = apply_filters(‘the_content’, substr(strip_tags($post->post_content), 0, 100));
which explains, why the line is truncated after exactly 100 characters.
Why aren’t you using https://codex.wordpress.org/Function_Reference/get_the_excerpt?
June 19, 2017 at 2:00 pm #4792Grace ThemesMemberHi
The slider in your website http://youlius-award.de/ is working fine and the empty line is not displaying.
Please check.
Regards
Grace ThemesJune 20, 2017 at 8:51 am #4803Andreas Ebbert-KarroumParticipantYeah, I fixed it myself in the meantime, thanks for pointing me to the correct location.
My header.php now uses this to display the first paragraph, max 200 characters, truncated at a word.
$title = get_the_title( $id );
$post = get_post($id);
$content_long = apply_filters(‘the_content’, substr(strip_tags($post->post_content), 0, 400));
$content = strtok(wordwrap($content_long, 200, “…\n”), “\n”);June 20, 2017 at 10:17 am #4806Grace ThemesMemberThat’s Great.
-
AuthorPosts
- You must be logged in to reply to this topic.