Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #691270

    Hello,

    Could you please help me to add the excerpt text into my website blog´s related posts field.

    The screen is here: http://imgur.com/a/rPee6

    #691749

    Hey pimroll!

    Please try adding following code to Functions.php file in Appearance > Editor

    add_filter('avf_related_post_loop','avia_related_excerpt');
    function avia_related_excerpt() { 
      $excerpt = get_the_excerpt( $post );
      $output = "<span class='related-excerpt'>".$excerpt."</span>";
      return $output;
    } 

    Cheers!
    Yigit

    #692151

    Hello Yigit,

    Is there a difference where do I place it in functions.php.

    Currently I placed it in the top and the excerpt text is not showing.

    Regards,

    #692155

    Hello Yigit,

    And now I deleted the same lines of code and it shows like this in mobile view http://imgur.com/a/npK7y

    Can you please look at it and place the code where it should be, so the excerpt text would show and the mobile view would be ok again.

    Best Regards,

    #692169

    Hello Yigit,

    Never mind I guess the change back took some time, now it is fine again but can you help me with inserting the excerpt text code into the functions php please.

    Thanks.

    Best Regards,

    #693162

    Hi,

    Please try placing it at the bottom :)

    Best regards,
    Yigit

    #693900

    Hello Yigit,

    I placed the code in the end of functions.php and the excerpt text is showing now but how can I customize it like this:

    http://imgur.com/a/5dHvd

    So basically I would like the title to be on top and would like to limit the size of the excerpt text about 3 times shorter.

    Is there any way?:)

    Best Regards,

    #693907

    Hi!

    Please add following code to Quick CSS

    strong.av-related-title {
        float: left;
    }
    span.related-excerpt {
        float: right;
    }
    

    Regards,
    Yigit

    #694185

    Hello Yigit,

    Its better but not exactly like I want it to be.
    I would like, that the final layout would be like this: http://imgur.com/a/EQmnl

    For this it needs to:

    – The title needs to be on the same line with the excerpt text
    – The thumbnail shoul be in the middle of the line of the text
    – And I would like to have the control to change the length of the excerpt text (ideal would be 15-20 words not more).

    The example what I am looking for is here: http://imgur.com/a/EQmnl

    Is this doable?

    Best Regards,

    #695587

    Hi,

    both screenshot links you’ve provided are the same and the link you’ve provided does not work anymore (see private section). So please send us a precise link where we can inspect the elements in question.

    However, excerpt length is a default function of WordPress. Read here how to control it:

    Best regards,
    Andy

    #695933

    Hello Andy,

    The link is here: http://imgur.com/a/EQmnl

    And the new post address is in the private.

    Please help, since I did not find the line of code, which was explained in the link you sent me.

    Best Regards,

    #696411

    Hi,

    Read the tutorials carefully and then put the line of code into your functions.php.

    Best regards,
    Andy

    #711076

    Hello,

    Do you know, how can I change the number of related posts displayed below the blog post view?

    right now it displays all of them with the related tags.

    Best Regards,

    #711174

    Hi,

    Please go to Appearance > Editor and open related-posts.php file and find following

    'columns' => 6,

    and change it to

    'columns' => 3,

    Best regards,
    Yigit

    #712383

    Hello Yigit,

    Thanks, got it:)

    #712535

    Hello Yigit,

    Is it possible to add the post date also into the related post field?

    Best Regards,

    #712898

    Hi,

    Please edit the same file and find

    
    $output .= 		"<strong class='av-related-title'>".$related_post->post_title."";
    

    and add following code right below it

    $output .=      get_the_time(get_option('date_format'));

    Best regards,
    Yigit

    #712939

    Hello Yigit,

    It worked but is it possible to align the date in the same line as title of the post?

    http://imgur.com/a/8v3dn

    #712944

    Hi!

    I changed the code to following one

    $output .=      "<span class='related-date'>".get_the_time(get_option('date_format'))."</span>";

    and added following code to Quick CSS

    span.related-date {
        padding-left: 15px;
    }

    Please review your website now :)

    Regards,
    Yigit

    #713078

    Thanks all good now:)

    #713085

    Hi,

    glad we could help. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.

    Best regards,
    Andy

Viewing 21 posts - 1 through 21 (of 21 total)
  • The topic ‘Add excerpt text in the related post field’ is closed to new replies.