Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
2.0k views
in Q2A Core by

I want to add a code in questions > most views page , I am using this; 

if ( $this->template == 'questions' ) {

but it's displaying in other pages too (most answers , most votes , hot ...) I want to display only in most views page is it possible? 

best regards 

Q2A version: 1.6.3

1 Answer

+2 votes
by
selected by
 
Best answer

This should do it:

if ($this->template === 'questions' && qa_get('sort') === 'views') {
    echo 'Yeah!';
}

 

by
thank you very much ,,, work like a charm
...