https://www.question2answer.org/qa/71112/how-to-change-the-nav-link-of-question-to-external-link(refer this link please)
I want to acheive the same functionality for tags,where i need to modify the nav-link of tags...
Solution by pupi for modifying the nav-link of question:
1. Locate this line: https://github.com/q2a/question2answer/blob/3320b653f94ffa1f004d51cc82f0e95f573ff411/qa-theme/SnowFlat/qa-theme.php#L365
2. Add in there this text:
$q_item['url'] = 'https://www.google.com/search?q=' . $q_item['title'];
1. Locate this line: https://github.com/q2a/question2answer/blob/3320b653f94ffa1f004d51cc82f0e95f573ff411/qa-theme/SnowFlat/qa-theme.php#L54
2. Copy/Paste this code:
public function post_tag_list($post, $class) { foreach ($post['q_tags'] as &$taghtml) { preg_match('@<a .*?>(.*?)</a>@i', $taghtml, $matches); $taghtml = preg_replace(array('/href=".*?"/i'), array(sprintf('href="https://www.google.com/search?q=%s"', qa_html($matches[1]))), $taghtml); } parent::post_tag_list($post, $class); }
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.