Forums › Forums › Search & Filter Pro › How to get audio files to play in search results?
- This topic has 5 replies, 2 voices, and was last updated 4 years, 5 months ago by Trevor.
-
Anonymous(Private) May 29, 2020 at 5:57 pm #246639
Any idiot’s guide to get me on the road to playing audio files in the search results?
These are audio files inserted into posts (or custom-posts) using some kind of media player.I don’t want perfection at this stage, just enough to see if the system would work fast enough — a bit like in the Search & Filter demo with all the movies in search results.
Would be super-grateful for pointers to let me try this out.
Trevor(Private) June 1, 2020 at 1:08 pm #246722We have no guide, sorry.
You would first have to start with an archives page that has all the functionality, player etc, that you need, but no search. And then add the search functionality.
The issue is how our plugin would attach itself to the query that makes your page, and, if your page uses javascript to add the player (most do, even the standard media player that ships with WordPress does), how to then reapply that when a search is made. I did recently show another user how to do the latter as they were using the standard WordPress media player and they coded the PHP template file themselves.
Trevor(Private) June 3, 2020 at 12:02 pm #247122Do you actually have posts with the audio files inserted already in the content?
If so, can you follow this setup for now:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
In particular, follow the instructions in the Customising section.
That will give you a
results.php
file you can edit, in a sub-folder namedsearch-filter
in your theme folder.You need to find this line:
<p><br /><?php the_excerpt(); ?></p>
and replace it with something like:
<p><?php echo get_the_content(); ?></p>
You can edit pretty much anything in this file, but make small changes and test.
Anonymous(Private) June 29, 2020 at 10:50 am #250396Dear Trevor, a late thank you for this further support you’ve given me. I have kept hold of it while dealing with other things, and hope it will get me some steps further when I look into this again.
Yes, I do have lots of custom posts,each with one audio file in the content, and that is what I want to make searchable, with the ability for the search results to show playable files.
I now realise that on the plugin demo of movie files, you can’t actually play the movies from the results page, so that is a big difference in how I want results.
Thank you for now.
Eva -
AuthorPosts