Remove views count and date from question meta but keep category / tags

4.74K viewsWordPress
1

Hi !

 

I’d like to remove view count and date from question meta, but keep showing the category / tag.

I have been hacking the plugin : I went to includes/qaquery.php and commented out the following lines :

 

//  $metas[’views’] = ‘<i class=”apicon-eye”></i><i>’ . sprintf( __( ‘%d views’, ‘anspress-question-answer’ ), $view_count ) . ‘</i>’;

// $metas[’active’] = ‘<i class=”apicon-pulse”></i><i><time class=”published updated” itemprop=”dateModified” datetime=”‘ . mysql2date( ‘c’, $last_active ) . ‘”>’ . $last_active . ‘</time></i>’;

 

It works, it removes views count and date but I’m looking for a neat way to do this because in the next Anspress update my changes will be reverted back since I directly hacked the plugin.

How should I do ?

Thanks a lot  🙂

1

Hello,

Here is the hook you require. ap_display_question_metas

And here is the working example:

Loading Gist...
commented on answer

It works like a charm. Thanks Rahul you rock !!! 🙂