Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
in Q2A Core by
Is there Any way to create the Internal link on all questions for a particular Word

Like If I wants to Create the Internal DoFollow Link for the word "google Cloud" on all the questions in my Q2A Site? I understand for wordpress there are plugins which can create that easily

Any code or help would be appreciated
Q2A version: 1.7

1 Answer

+2 votes

You should be able to get all the questions containing a particular word with a database query like this:

SELECT p.postid, p.title
FROM qa_posts p
  INNER JOIN qa_contentwords c ON p.postid = c.postid
  INNER JOIN qa_words w ON c.wordid = w.wordid
WHERE w.word = '...' AND p.type = 'Q';

Note, however, that "google cloud" are two words not one, so you may need to adjust the query to take care of that.

With the post ID and title you can then construct the path to each question like this:

$q_path = qa_q_path($id, $title);

where $id is the post ID of the question and $title is its title (as returned by the database query).

Related. Also related.