Forums › Forums › Search & Filter Pro › Can’t find function when archive page is on wp-content
Tagged: loop.php
- This topic has 42 replies, 3 voices, and was last updated 4 years, 7 months ago by Anonymous.
-
Anonymous(Private) March 19, 2020 at 2:14 pm #237208
Hello,
Working with this nice plugin for a while, but everytime the theme I use is being updated, it removes the necessary files from the wp-includes folder. So, therefor we’ve placed the files in the wp-content folder.
It works, but there is no loop functionality.
It looks like some extra functionality can’t find a needed function when the files are on wp-includes, but not on the wp-content.
Can you help out?
Trevor(Private) March 19, 2020 at 5:02 pm #237240What files are you referring to?
Normally, one should work with a child theme. If you are not, then make one using the Orbisius plugin that will do it for you. Simply accept the default settings and it will make and activate it for you, then you can remove that plugin.
Modified files should always be kept in the child theme folder. For example, if you modify our results.php file, make a sub-folder in that child theme folder named
search-filter
and place the modified file in there.Anonymous(Private) March 20, 2020 at 3:24 pm #237370Thank for answering. The title of this post is not correct. Sorry for the confusion.
I’ve replaced the custumized loop.php to the child themes includes-folder.
But I see that the files are not being used.
Why is that?
Do I need to refer to the loop.php from within the S&Fplugin? If yes, how?The problem I am trying to solve here is that the loop.php is being deleted when it is inside the themes includes-folder.
Ross Moderator(Private) March 20, 2020 at 4:49 pm #237399Hi Elly
This sounds like a complicated issue!
I just need to ask some basic questions so we’re all on the same page.
Firstly, can you confirm, have you created a child theme from the theme you want to use?
https://developer.wordpress.org/themes/advanced-topics/child-themes/
This protects your modifications when you have to update the theme.
Thanks
Anonymous(Private) March 20, 2020 at 7:39 pm #237451Hello Ross,
I don’t know if complicated is the word, but it isn’t straightforward, you are correct on that.
Will explain a bit what we did.
On the website we have, we import two feeds from an external database.
Those feeds go via ACF to two different Custom Post Types.
We use your plugin to search and filter the data from both the feeds.
We made a different loop.php-files for each of the CPT.
The files are stored together with the default loop.php in the folder includes in the theme folder.So far so good, working smooth!
But everytime the theme gets an update, the two custom loop-files disappear.
And I re-upload them to have it all working again.I would like to store the loop-files in another folder, while I prefer not to use a child-theme.
I therefor put the files in the wp-content folder.
(I put the location in the filename for template options, something like “../../wp-content/loop-vacature.php”. I know that this is not for that purpose, but I mention it to give you the complete information.)
When I hit search, I only saw one item. Not on a page, not multiple, just one item.
It looks like those files did work (?) but some extra functionality can find a needed function when the files are on wp-includes but on on the wp-content.I opened this question on your forum and got the answer of Trever to use the child-theme.
Although I don’t want to use a child-theme (will explain that later), I wanted to see what happens. I made the child-theme, put a folder includes in it and in that folder the loop.php-files.
This did not have the result I was expecting.
We can go debugging the issue of course, but what more important is to me, is the question if the custom loop.php can function when it is in the wp-content or other ‘safe’ location.
The reason therefor is that this external database will not only be used on ‘my’ website, but also on other partner-websites. I would like to use the S&F-plugin on those websites as well, but I really cannot ask the partners to all have their themes changed to a child-theme. I simply can’t do that.So, the real question is: how can I store the custom loop.php-files in a ‘safe’ folder without losing the functionality?
Hope you can help!
Thanks in advance,
EllyAnonymous(Private) March 22, 2020 at 5:43 pm #237482Hello Ross,
This is an addition to my former reply.
Take a look at the file on: https://poolwest.nl/searchresults.pdf
I think this explains what happens.
The custom loop.php is working, but has some css issues/bugs it was not having while it was on the includes of the themes’ folder.That can be corrected, but then my question about how to proceed when an child-theme cannot be used is a question I would love to get an answer on.
Thanks, Elly
Trevor(Private) March 23, 2020 at 12:32 pm #237534I think I understand (as you say, it is somewhat complicated).
You could make a plugin of your own, which would then have a folder in the plugins folder, in which you could store the files.
Search & Filter Pro does not actually call that loop file. It will still be the theme doing that.
As to it not working in a child theme (assuming the child theme was activated), I do not know if the loop files would have to be in a folder structure the same as the theme or simply in the parent folder. But, as you say, this is not really an option anyway.
Anonymous(Private) April 9, 2020 at 8:11 pm #239601Hello Trevor, sorry for the late reply.
I do not understand your answer, sorry for that.
I had a plugin developed for the custom post I use. The same developer made the loop-files for me. He did not store them in the plugin folder, but followed the instructions an made a custom loop inside the shortcode that the plugin provides.
Then about the theme calling that loop file. Why is there an option on the plugin settings to specify a file to be used when it is the theme calling it?
The strangest thing is though, that the loop-files do work while stored in the child theme’s folder but only partially (see pdf in the previous message). So why does it fall back to some default options?
I know it is not doable to oversee all complexity and mistakes we’ve maybe made by building the website, it is often a matter of little details. So I don’t ask to troubleshoot it, but I would like to understand how this works, just because I want to use your plugin on more websites.
Thanks for replying,
Elly -
AuthorPosts