-
AuthorPosts
-
September 24, 2016 at 9:56 pm #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
September 26, 2016 at 4:13 pm #691749Hey 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!
YigitSeptember 27, 2016 at 12:10 pm #692151Hello 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,
September 27, 2016 at 12:16 pm #692155Hello 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,
September 27, 2016 at 12:28 pm #692169Hello 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,
September 29, 2016 at 3:27 pm #693162September 30, 2016 at 4:32 pm #693900Hello 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:
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,
September 30, 2016 at 4:36 pm #693907Hi!
Please add following code to Quick CSS
strong.av-related-title { float: left; } span.related-excerpt { float: right; }
Regards,
YigitOctober 1, 2016 at 9:35 am #694185Hello 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/EQmnlFor 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,
October 5, 2016 at 4:27 pm #695587Hi,
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,
AndyOctober 6, 2016 at 9:06 am #695933Hello 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,
October 7, 2016 at 12:03 pm #696411Hi,
Read the tutorials carefully and then put the line of code into your functions.php.
Best regards,
AndyNovember 11, 2016 at 11:46 am #711076Hello,
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,
November 11, 2016 at 3:27 pm #711174Hi,
Please go to Appearance > Editor and open related-posts.php file and find following
'columns' => 6,
and change it to
'columns' => 3,
Best regards,
YigitNovember 15, 2016 at 10:24 am #712383Hello Yigit,
Thanks, got it:)
November 15, 2016 at 4:29 pm #712535Hello Yigit,
Is it possible to add the post date also into the related post field?
Best Regards,
November 16, 2016 at 2:21 pm #712898Hi,
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,
YigitNovember 16, 2016 at 3:32 pm #712939Hello Yigit,
It worked but is it possible to align the date in the same line as title of the post?
November 16, 2016 at 3:38 pm #712944Hi!
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,
YigitNovember 16, 2016 at 5:34 pm #713078Thanks all good now:)
November 16, 2016 at 5:38 pm #713085Hi,
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 -
AuthorPosts
- The topic ‘Add excerpt text in the related post field’ is closed to new replies.