badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Service widget content displayed on main page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #40692
    info110
    Participant

    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.

    #40726

    Hi 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!

    #40758
    info110
    Participant

    So 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.

    #40764

    Hi 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!

    #40913
    info110
    Participant

    When I replace the above code with the suggested code, nothing is displayed.

    Any suggestions?

    #40931

    Hi 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!

    #40937
    info110
    Participant

    Still 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.

    #40938

    Hi 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!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.