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

I wanna add few stuff to qa_post_html_fields funtion in qa-app-format.php and already did it but woth core hack. How an I override it without touching the core, using layer or plugin?


Maybe you don't really need to override anything. What is exactly what you're looking for? I mean, your requirement, to put it some way
Hi Pupi
In question list and question page I wanna style the category name next to the title of that question according to the logic below:
if (categoryNumber == 1 ){
     echo (categoryName in red + question title )
} else  {
    echo (categoryName in blue+ question title )

2 Answers

0 votes
selected by
Best answer

Based on your comment, you just want to add the category title before the question title in question view and question lists. It is not necessary to override a 362-line function to do so.

Answer is a bit long so I'm exceeding the max answer length so I created this Gist: https://gist.github.com/pupi1985/ebeb18fae2d8cc9cf31f

You should modify your qa-theme.php accordingly.

Then just apply the CSS based on your category: span.qa-q-item-title-cat-44 applies to category id 44. A screenshot might help users who don't find it easy to follow code:

You were right about the interfering. Thank you!
And btw i am appending the category to the title for better SEO! Not %100 sure it helps though
Welcome. Sorry, I don't know much about SEO but being a Stack Exchange frequent user I'd advise you to ask that in http://webmasters.stackexchange.com
Getting back to you buddy, Thank you for the tips I finally decided to use this beauty:http://www.question2answer.org/qa/35946/q2a-breadcrumbs-v1-1-released-now-its-free
with the hope to improve my SEO
0 votes

1\ In qa-plugin.php

qa_register_plugin_overrides('Your plugin php file').

In "your plugin php file," just override the function you want to change.



Thank you for your input, the issue is qa_post_html_fields cannot be overriden