Change Slider Description max length?
-
Is there any way to increase the maximum length of the Slider description text? Right now the max length is 250 characters.
-
I found the code that controls this (or at least I thought it did) in the class-admin-meta_boxes.php file found in themes/customizr/inc/admin. I changed the values to 350 and saved it to my child theme but it had no affect on the number of characters allowed in the slider description. I’ve been melting my eyes out going thru a bunch of php files still looking for the actual code that controls this and will do so until I find a solution. I will let you know here if I do. Likewise, if you find a solution, let me know. Thanx.
That didn’t work for me either. Thanks for the reply though. I’ll keep looking too!
The code is in /parts/class-content-slider.php #72-85.
I’ll write a snippet to change this if it would help, rather than hacking core files in the child theme?
That would be great. Thanks so much for the quick response.
Strange, it doesn’t seem to be working for me even after changing that code. Is there anything else that needs to be altered?
The length was increased to allow the theme to work with qTranslate.
However, are you sure you want such long text? It screws up bigtime on small devices.
Thanks for the reply @electricfeet. I don’t necessarily need 350 characters. In fact I only need about a dozen or so more characters to fit all the text I need in the slider images. Just the ability to change it somehow would be nice. Besides that, it’s just odd that I can find the code in the php files but amending it has no affect.
Thanx
If you don’t have qTranslate installed, the limit is 250 (it gets truncated by
class-admin-meta-boxes.php
(search on ‘tc_slide_text_length’)).If you do have qTranslate installed, then
class-fire-init.php
does a whole load of stuff, including removing this limit (search on ‘tc_remove_char_limit’)).This should work (lifted from the code that Nikeo uses in class-fire-init.php):
//sets no character limit for slider (title, lead text and button title) and featured pages (text) => allow users to use qtranslate tags for as many languages they wants ([:en]English text[:de]German text...and so on) add_filter( 'tc_slide_title_length' , 'my_remove_char_limit'); add_filter( 'tc_slide_text_length' , 'my_remove_char_limit'); add_filter( 'tc_slide_button_length' , 'my_remove_char_limit'); add_filter( 'tc_fp_text_length' , 'my_remove_char_limit'); function my_remove_char_limit() { return 99999; }
Paste in your functions.php and you can extend your slide descriptions right down to the footer if you want ??
p.s. If you’re on OS X, EasyFind is a real boon for finding strings within files. I’d be lost without it. Select the Customizr folder and it finds everything (even if you’re not running a local server, you can simply download the theme and unzip it to your disk and search there).
Thanx for the response, ElectricFeet. I am not using qTranslate as I have no need for it (at least for now). I have scoured the class-admin-meta-boxes.php file using TextWrangler (which has a helpful search function) and found all the lines that included the slider text length and changed all those values to 350 (just to be on the safe side). However, these changes still had no affect.
With this not working, I went ahead and installed qTranslate (and made the suggested changes to it’s code since it’s not initially compatible with WP 3.8) and added your suggested code to my child’s functions.php file. Still no change to the number of characters that will display in the slider text.
I’m at a loss here. I’ve been able to find and change codes in a number of files in a number of themes and they all do what they are supposed to do. But for some reason, making any changes for this one (seemingly) simple function does not result in the desired affect.
Unfortunately, this is not a good thing as my client doesn’t want to change the copy used in the slider text and as I looked for another workaround I’ve discovered that the slider link button doesn’t work when I activate it.
If anyone has found as solution to this I would be eternally grateful as my clients is hoping to have this site finished asap (naturally). Thank you in advance.
I should have explained better. The “This should work…” paragraph was unrelated to the previous two. That is, the code I pasted in the box should/might work without qTranslate installed.
But Dave has a better solution that you can adapt for the slider here.
Yeah, it didn’t work either way unfortunately. But I appreciate the input. It always helps to try things that don’t work. It’s still a good way of learning. I’ll certainly check out those links! I’ll let you know if they help and if so, how. Thanx!
Yes, he gave me a simple fix to the button issue by applying the z-index to #customizr-slider and NOT the button itself.
He also said that there is not a filter in ver 3.0.9 that allows to extend the max number of characters in the slider text.
Thanx again for your help with the Electric Feet.
I’ll mark this as resolved as soon as the “Resolved” check box shows up here.
- The topic ‘Change Slider Description max length?’ is closed to new replies.