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

So like for example instead of the sentence "How do you do this"  it will automatically say "How do you do this?" with an inserted question mark.

 

EDIT:   Hi thx for answer.  Just copy n paste to my theme?  Tried this but it gave me a HTTP Error 500

by
edited by
I don't think the qa version really matters, but what version are you using?
And what theme?
I updated the code incase you are using snow theme!
Check in qa-theme.php to see if one of the function already in there.
by
simply add a "?" at the end of title will make something look strange

2 Answers

+3 votes
by
edited by

Just add this function to your qa-theme.php

  
  function q_item_title($q_item)
  {
                   if (strpos($q_item['title'],'?') !== false) {
       $ap = '';
    }else{
    $ap ='?';
    }
   $this->output(
    '<DIV CLASS="qa-q-item-title">',
    '<A HREF="'.$q_item['url'].'">'.$q_item['title'].''.$ap.'</A>',    '</DIV>'
   );
  }

 

  function title()
  {
   if (isset($this->content['title']))
                   if (strpos($this->content['title'],'?') !== false) {
       $ap = '';
    }else{
    $ap ='?';
    }

    $this->output($this->content['title'].$ap);


  }

 

If you have a snow theme then do it this way:

Replace the function title() with this one:

 

        function title() // add RSS feed icon after the page title
        {
             if (isset($this->content['title']))
                                if (strpos($this->content['title'],'?') !== false) {
       $ap = '';
    }else{
    $ap ='?';
    }
            $this->output($this->content['title'].$ap);
            $feed=@$this->content['feed'];
            
            if (!empty($feed))
                $this->output('<a href="'.$feed['url'].'" title="'.@$feed['label'].'"><img src="'.$this->rooturl.'images/rss.jpg" alt="" width="16" height="16" border="0" CLASS="qa-rss-icon"/></a>');
        }


 

–1 vote
by
If you dont want to modify php than most easiest and alternate way to add question mark is using css after. something like.. qa-title:after{ content: "?"; } check what is the class for title and use that. Also if ? dosnt work than you may need to use ASCII code.. nothing complicated.
by
This works great!!  I had never heard of this from css.  Very simple solution and it allowed me to target the specific classes I wanted to add the "?" too.
by
Yes, CSS can do many stuffs in fact and not required to modify core php code. I don't know who didn't understand my answer and gave negative vote.. or may be just did that.. :P never mind.. enjoy
...