Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
500 views
in Q2A Core by
I am looking for some hack to add some extra css classes. Can anyone know me how to find function like for content and question list also how to add extra css classes to thos section e.g. <div class="extra class"> (not with extra div but into existing div)
Q2A version: 1.5 beta

1 Answer

+1 vote
by
selected by
 
Best answer

My method is like this:

1. First read up on advanced themes if you haven't already.

2. Use Chrome's Developer Tools or Firebug for Firefox. On the page, right click and click "Inspect Element" to find the exact element you're looking to change.

3. Check and see if that element is in qa-theme-base.php, e.g. search for "qa-q-view".

4. Copy the function to your qa-theme.php then add your extra class or make other modifications.

by
Thanks a lot, I got it works.. But I couldn't found one class with span.. so don't know.. but I got solution with alternate function....hope I will be able to find all function what I need. Thanks again.
by
Some function unable to find fore e.g. I am trying to find logo <a> tag but in theme-base.php file I am getting this only..

'<DIV CLASS="qa-logo">',
$this->content['logo'],
'</DIV>'

So where to find tag inside <DIV CLASS="qa-logo"> means for $this->content['logo'],
by
What is home url variable? like ['site_name'] for website name I want home url variable.
by
Some parts of the HTML are generated inside core files, and passed to the theme in the $this->content variable.

The current URL is in $this->content['q_view']['url'] if that's what you mean. If not, try searching this site, as it's sure to have been asked before.
by
edited by
I am looking for home url means www.mysite.com where qa root is located. i am trying to do below thing...

---------------------------------------------------------------------------------

$this->output('<DIV CLASS="footer-copyright">');
            $this->output('<p>Copyright &copy; '.date('Y').' <a href="'.$this->content['url'].'">'.$this->content['site_title'].'</a> - All rights reserved.</p>');
            $this->output('</DIV>');

---------------------------------------------------------------------------------
as you can see in above code I am trying to add footer site copyright note dynamically so anyone who will use this theme doesn't have to set home url and site name manually. Can you please suggests me to do in better way or get it works..

As the code I have added in <a href=""> for home link its only giving current page link as you have described in your previous comment. But this even giving me Undefined index error. however I want home url there.
...