Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

how can I make the character limit to extra field content ?

+1 vote
asked Apr 30, 2015 in Q2A Core by Korkut

I am using this code and it's working perfect ,,, but I want to display only 200 character of extra field content in homepage ... I have tried this but it doesnt work,,, 


$extra = qa_shorten_string_line($extra, 200);
Q2A version: 1.6.3

1 Answer

0 votes
answered Apr 30, 2015 by sama55

It might be this way?


$extra = qa_db_postmeta_get($post['raw']['postid'], 'qa_q_extra');
if(isset($extra) && $extra != '')
    $this->output('<span class="extra_on_list"> - ('.$extra.')</span>');


$extra = qa_db_postmeta_get($post['raw']['postid'], 'qa_q_extra');
if(isset($extra) && trim($extra) != '')
    $this->output('<span class="extra_on_list"> - ('.qa_shorten_string_line(trim($extra), 200).')</span>');

commented May 1, 2015 by Korkut
Yes I  want to display extra field content below the question title in question list,,,
commented Sep 10, 2015 by Rob Mansfield
Sama - where can I find the Extra Field plugin?