- This topic has 5 replies, 2 voices, and was last updated 3 years, 1 month ago by Tom.
July 1, 2017 at 6:52 am #342434Marcus
I am aware that this is not a correct request related to GP, but I need some hints for e.g. keywords to search for the correct code sniplets. All I want is avoiding to run into a totally wrong direction 😉
What I have to 2 separate PHP apps: a WordPress blog, and TNG, which is a database for genealogical research. TNG is stand-alone, but I actually added menu entries in WordPress to particular views in TNG. (Next step is wrapping WordPress header.php and footer.php around TNG and customize CSS to make it a seamless thing.
My issue is that I have 2 different apps with different searches. But I would indeed like to enter a search string into WordPress and see the results from both apps. Example: I enter the name of my grandpa, and I would like to yield articles where he is mentioned as well as the direct link to the TNG page with his personal record. (Plus maybe the link to the family record, when I learn how to add this)
I was first thinking about forwarding the query string to the TNG query, receive these results and mix this back. But I did not find any reference how this could be done.
My next idea is more “WordPress-ish”: creating a CPT and duplicate the entries from the other database into the WP database. This allows me to stay within WP only, for the price of redundant data. (Not to worry, just a few hundret records)
I could e.g. use a certain helper script behind the scenes to read from TNG database and create records in WP database.
Is this the way to go or is there even another scenario that I am not aware of?
Sorry for the noise.
MarcusGP Premium 1.3.1July 1, 2017 at 11:51 pm #342726TomLead DeveloperLead Developer
Great question, but a very complicated answer. You might have more luck getting an in-depth answer over here: https://wordpress.stackexchange.com/
Let me know 🙂July 2, 2017 at 4:30 am #342793Marcus
I was making some progess with the “Pods” plugin.
I created a CPT and the nice thing about Pods is that it allows easy templates for the display of the CPT posts.
It works really great. The first result shown here  is the CPT I created.
But I have an additional requirement related to your theme:
I would like to change the link of the CPT that it does not point to the WordPress post itself, but to my external genealogy database. I found an article , but I cannot identify the mentioned code in your theme. I expected this in the search.php file.
Where do I have to look?
Thank you.July 2, 2017 at 10:25 am #342933TomLead DeveloperLead Developer
What you would do is copy the content.php file and add it into your child theme. Then re-name is to content-search.php so it applies only to search results.
Doing that will allow you to replace
the_title()function with your own custom function.July 2, 2017 at 11:31 am #342991Marcus
Works perfect. Thank you.
The link to https://www.die-zurhorsts.de/?s=Mertesacker yields an example CPT which directs now directly to the TNG site.
MarcusJuly 2, 2017 at 9:18 pm #343164
- You must be logged in to reply to this topic.