Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #822239

    I am building this site

    I would like to limit the amount of copy that is supplied in the “blog preview” – is there a way to specifically limit it to certain color spaces, or will it effect the entire site wide?

    Thank you in advance!

    #822409

    Hey dvus4l,

    Sorry, but I don`t have sure about your question. Could you explain it with more details?

    Best regards,
    John Torvik

    #822822

    Hi John

    For instance, in the top 4 featured blogs (not all posts have been filled in, but you can see there are two written out) – I would like to shorten the preview to potentially 100 characters max. Just the preview for the click through of the entire read.

    Please let me know if that helps

    Thank you

    #824121

    Responding here as a solution has not been supplied – I am simply looking to shorten the “blog preview”

    Thank you in advance

    #824273

    Hi,

    Please add the following code on the functions.php file.

    add_filter('avf_post_slider_entry_excerpt', 'avf_post_slider_entry_excerpt_mod', 10, 4);
    function avf_post_slider_entry_excerpt_mod($excp, $prep, $perm, $entry) {
    	$excp = substr($excp, 0, 100);
    	return $excp;
    }

    Best regards,
    Ismael

    #832356

    Ismael,

    Thank you for the help. Is there a way to add a … to the cut off text so people know that it is eluding to reading more in the actual post? Is there also a way to assure that it won’t cut a word off mid spelling? That seems a bit odd

    Thank you in advance

    #832372

    Ismael –

    In addition to my response above, I have the top blog portions set to include a ‘read more’ link, however they’re not appearing now.

    Assistance is greatly appreciated

    #834570

    Hi,

    We would like to check the page again but it is password protected. Replace the filter in the functions.php file.

    add_filter('avf_post_slider_entry_excerpt', 'avf_post_slider_entry_excerpt_mod', 10, 4);
    function avf_post_slider_entry_excerpt_mod($excp, $prep, $perm, $entry) {
    	$excp = avia_limit_text($excp, 100);
    	return $excp;
    }
    
    function avia_limit_text($text, $limit) {
      if (str_word_count($text, 0) > $limit) {
          $words = str_word_count($text, 2);
          $pos = array_keys($words);
          $text = substr($text, 0, $pos[$limit]) . '...';
      }
      return $text;
    }

    Best regards,
    Ismael

    #835568

    Log in supplied in private – please let me know if you have any luck

    Thank you in advance

    #837946

    Hi,
    I have added Ismael’s code to your functions.php and the “read more” links are now showing.
    Please clear your cache and review, you can adjust the except length to suit.

    Best regards,
    Mike

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