Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
852 views
in Q2A Core by

For instance, let's say that I wanted to hide something from the login page, but have it appear everywhere else.

Naturally, this is a good solution for a PHP conditional.

<?php
if qa_login {
echo '';
} else {
echo 'abc';
}
?>

Of course, something like qa_login doesn't exist. Looking at http://www.question2answer.org/functions.php it seems there might be a function that can help me, but if there is it's going over my head.

I realize that we have helpful body classes .qa-template-login to assist with styling, but this is concerning content.

Thank you.

1 Answer

+1 vote
by

Maybe this can help:

if (qa_request() === 'login') { 
    echo 'This is the login page'; 
} else { 
    echo 'This is not the login page'; 
}

In a layer, the condition could be $this->template === 'login'

...