Comments (9)
Hi Nick,
Thank you for using this plugin.
You're the first person that I don't know, that uses one of my small open source contributions! 🎉
I've installed the plugin on a fresh WordPress install and found a bug; probably the same bug that you encountered. Fixed the problem and pushed it to this repo: 65209ab. Can you check if that solved your problem?
from wordpress-ajax-filter-posts.
Hi Robbert,
On a Google search for AJAX post filter plugin, your project comes right up!
I just updated my code, and the issue still seems to be occurring. If it's helpful, I push it to a test WordPress environment I've set up so you can see what's happening?
Thanks for the prompt response! I'd love to use your plugin over a bloated alternative :)
from wordpress-ajax-filter-posts.
Ah, unfortunately.
Yes please, that would be helpful. Although I'll be only able to see what you sent to the server, not what the specific error is.
Some other data that would be useful to solve this:
- Can you see a possible error in the php error log?
- What php version do you use?
from wordpress-ajax-filter-posts.
Ah, I just turned debug on and I'm seeing the following PHP error:
Notice: Use of undefined constant ICL_LANGUAGE_CODE - assumed 'ICL_LANGUAGE_CODE' in C:\wamp64\www\wp-dev\wp-content\plugins\ajax-filter-posts\class-ajax-filter-posts.php on line 85
The same error is thrown for line 86. Can I somehow disable the language option?
Also, in my WAMP setup, I'm using PHP version 5.6.25
from wordpress-ajax-filter-posts.
Ah, the if statement around function_exists('icl_object_id')
above the use of that declaration should skip that code if you don't have WPML installed. That prevented in my test case, when WPML not installed. Can you replace the function function_exists('icl_object_id')
with defined('ICL_LANGUAGE_CODE')
to see if that fixes it? You'll find that function, two times in the class-ajax-filter-posts.php file. On line 89 and on line 273
from wordpress-ajax-filter-posts.
Because your error is on the wrong line number, I think you still have the older version of the plugin, before the fix in commit 65209ab.
from wordpress-ajax-filter-posts.
Ah ok, I thought I had updated the plugin with that commit- I will check, thank you!
from wordpress-ajax-filter-posts.
Ok, I've got it working! Sorry, I realized I was in fact using the older plugin version. I have a couple modifications I'd like to add for my project, and I'm wondering how difficult they'd be to add? I'm attaching a mockup for reference- first, would it be relatively simple to add the active tags above the search results, with '[x]' buttons to allow quick toggling of the filters? Secondly, how would one go about formatting filter output markup to indent child taxonomy terms under their parent, as in the visual? Thanks for any assistance- I was contemplating using a different plugin, but I'd much rather use your approach!
from wordpress-ajax-filter-posts.
There are several ways to go:
- You add the files of the template folder to you your theme in the folder
ajax-filter-posts
. With that you can change the HTML markup of the all the created HTML of this plugin. For example you could add an extra class to the filters if they are child-categories (check if $filter->parent != 0).
You can add your own CSS in the theme and, if you make a lot of changes to the css, dequeue the CSS from the plugin to prevent loading of a lot of unneeded styles.
You can create your own JavaScript event listeners that listen on changes of the checkbox. When a checkbox is checked you can add that filter as pills above the results and remove it on uncheck. To create the remove button in the pills you can add an eventListener there that triggers an uncheck event on the corresponding filter in the sidemenu.
- You can create a fork of this plugin and add features of option 1 directly in the plugin.
Now the bug is solved, I'll close this thread. Good luck with your project and feel free to ask more questions!
from wordpress-ajax-filter-posts.
Related Issues (20)
- Make string 'toon meer' en 'toon minder' translatable
- Remove opinionated styling: more focus on the core concept of this plugin AJAX fetching and filtering
- Create a way to add this plugin as a composer package
- Initiate the plugin without the use of a shortcode
- Add the ability set a WordPress filter on the posts query arguments HOT 8
- There is an option to sort order and order by? HOT 3
- Don't allow users to set different post types in the AJAX call
- Target a specific instance of the shortcode in the filter hooks HOT 1
- Post status HOT 2
- Clear button HOT 2
- Hook to override template HOT 3
- Trigger filter selection with hash url HOT 1
- Load more HOT 2
- meta key HOT 1
- JSON Parse error HOT 1
- See all terms even if there is no product linked to one of them HOT 2
- It is not possible to set specific styling for a taxonomy filter list
- It is not possible to have a filter that selects just one and deselect other options on select
- Accessibillity could be better
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordpress-ajax-filter-posts.