- This topic has 7 replies, 2 voices, and was last updated 8 years, 10 months ago by Theme Horse Support Team.
-
AuthorPosts
-
December 25, 2015 at 2:15 am #40692info110Participant
The service widget appears to pull the content from the associated page for each of the services that is displayed on the home page.
How can I have it display only a set amount (much less than the max amount it currently displays) or something completely different?
Basically I want all of the Read More links at the bottom of each of the services to line up with each other.
December 28, 2015 at 5:56 am #40726Theme Horse Support TeamKeymasterHi info110,
You need to increase the excerpt length for it. Goto theme folder-> inc -> functions-> functions.php on line no 146, there you can increase/decrease the excerpt length.(Currently its 50)
Before making any changes in the code first of all create a child theme and then customize the code. So that while updating to new version your customized code will be safe.
Thank you!
December 29, 2015 at 12:50 am #40758info110ParticipantSo I see excerpt length is words.
Any chance you can tell me how to change it to characters or at least what/where the function that is defining a word and I could hack on it to figure out how to change to character.
December 29, 2015 at 6:10 am #40764Theme Horse Support TeamKeymasterHi info110,
If you like to change the character not word then it needs code customisation. You can use similar this way.
<?php $service_excerpt = get_the_excerpt(); $service_content = substr($service_content, 0, 100); echo $service_content; ?>
This above code will only display upto 100/ less characters including space too. Now you can change the value of 100 what ever you want.
Inside the theme folder -> inc -> widgets on line no 286 you will find this code
<?php the_excerpt(); ?>
Here you need to add the above code.If you are still unable to fix it then you need to hire a developer and also before making any changes in the code first of all create a child theme and then customize the code. So that while updating to new version your customized code will be safe.
Thank you!
January 3, 2016 at 10:11 pm #40913info110ParticipantWhen I replace the above code with the suggested code, nothing is displayed.
Any suggestions?
January 4, 2016 at 7:11 am #40931Theme Horse Support TeamKeymasterHi info110,
Oh Sorry! just add this below code
<?php $service_excerpt = get_the_excerpt(); $service_content = substr($service_excerpt, 0, 10); echo $service_content; ?>
Hope this may help you
Thank you!January 4, 2016 at 9:40 am #40937info110ParticipantStill didn’t work.
Thanks for trying, but I managed to get the effect by just reducing the work count for excerpt length and didn’t need to switch to characters.
January 4, 2016 at 10:40 am #40938Theme Horse Support TeamKeymasterHi info110,
We have tried with the above code at our local environment and it’s working fine there. Are you trying at the core theme file or at child theme?
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.