Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Different Types on multisite
- This topic has 19 replies, 2 voices, and was last updated 5 years, 11 months ago by
till.kemper61.
-
AuthorPosts
-
June 25, 2020 at 9:49 am #28079
till.kemper61
ParticipantHello, we have the problem, that we have a wordpress multisite, we would search at all Blogs, but we only can choose the post types wich is selcected, we would serach for Products at shop.njf.de and downloads at archiv.njf.de. I cant choose all types i want.
June 25, 2020 at 12:05 pm #28083Ernest Marcinko
KeymasterHi,
Can you please add temporary back-end and FTP access details? I will check out the issue directly, as well as do a few lines of debugging. Thank you!
July 3, 2020 at 2:05 pm #28241till.kemper61
ParticipantYou cannot access this content.
July 6, 2020 at 8:30 am #28252Ernest Marcinko
KeymasterYou cannot access this content.
July 6, 2020 at 8:34 am #28254till.kemper61
ParticipantI have corrected the user.
ThanksJuly 7, 2020 at 10:27 am #28275Ernest Marcinko
KeymasterThank you very much, I was able to debug now.
I investigated the underlying problem, and found out that in wordpress there is no way to access all custom post types across the network. This makes it a bit more difficult, and it looks like there is no way to bypass this either.
I believe the best and easiest solution would be:
– Create 2 search bars – one for the shop, one for the downloads
– Configure the first on the shop multisite
– Configure the second on the site where the downloads are enabled
In that case, the desired post types should be available.July 7, 2020 at 10:31 am #28276till.kemper61
ParticipantHello, thank you, but this solution is not possible, because we are want serach to all Subdomains on the Mainpage. (njf.de) So when i only can search for things on the Mainpage with include downloads or with include products.
Is it possible to conntect the Data of 2 Search Bars to 1 Search Bar?
July 7, 2020 at 10:33 am #28278Ernest Marcinko
KeymasterThis would only work, if the woocommerce (or other store) and the download plugins are network activated – otherwise they are not accessible across sites, WordPress does not allow that unfortunately.
In that case, you should be able to see the post types in the list as well, on all sites.July 7, 2020 at 10:36 am #28279till.kemper61
ParticipantThanks, i test to activate the download Plugin Network width and generate a Serchbar on the Shop site wich include the Products and the downloads.
July 7, 2020 at 10:43 am #28280till.kemper61
ParticipantIt ist working.
Is it possible to shown the PDF Logo in the Search bar bevor the document Title? like on https://archiv.njf.de/downloads/?
Kind Regards
TillJuly 7, 2020 at 3:06 pm #28285Ernest Marcinko
KeymasterHi Till,
Well, not possible via settings, but it might be possible via custom coding. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter( 'asp_results', 'asp_attachment_image_custom', 10, 1 ); function asp_attachment_image_custom( $results ) { // Parse through each result item foreach ($results as $k=>&$r) { // PDF custom image if ( isset($r->post_mime_type) && strpos(strtolower($r->post_mime_type), 'pdf') !== false ) { $r->image = 'https://archiv.njf.de/wp-content/plugins/download-manager/assets/file-type-icons/pdf.svg'; } } return $results; }July 7, 2020 at 3:55 pm #28287till.kemper61
ParticipantIt is not working, i put in this code to my /wp_njf_multisite/wp-content/themes/Avada/functions.php but noting is happening in the frontend.
/*PDF Logo in Search*/ add_filter( 'asp_results', 'asp_attachment_image_custom', 10, 1 ); function asp_attachment_image_custom( $results ) { // Parse through each result item foreach ($results as $k=>&$r) { // PDF custom image if ( isset($r->post_mime_type) && strpos(strtolower($r->post_mime_type), 'pdf') !== false ) { $r->image = 'https://media.njf.de/2020/07/pdf.png'; } } return $results; }If you will probatly test it i have actualisate the ftp entry
July 8, 2020 at 9:45 am #28295Ernest Marcinko
KeymasterYou cannot access this content.
July 8, 2020 at 10:25 am #28300till.kemper61
ParticipantYou cannot access this content.
July 8, 2020 at 12:21 pm #28304Ernest Marcinko
KeymasterThose are post types I assume? I cannot tell without back-end access. If the icon is not within the content or as featured image, the plugin cannot parse that. If this is a custom post type, then there is probably some sort of an API with the downloads plugin, that might be able to return the icon image. Let me know if you know how to do that, and I will help to integrate.
-
AuthorPosts
- You must be logged in to reply to this topic.