It all depends on the type of the materia attribute, if it’s a select attribute, then you also need 2 underscores and an ID, for example __id(), because just get_material will return an array of objects.
As for CSS, we can only provide general guidance. If the styles don’t work at all, we recommend using Web Inspector, 1 clear selector is enough, if you list several with a space, it will not work HTML Styles CSS.
Materia is a text area attribute that must be compile by a user when he is publishing a new listing. What should I add to that code for showing the releted listings with the subject and not only the category?
If it is a text attribute, then everything should work correctly. Please try to debug this using var_dump or error_log to check the values in get_material and others. Also, please note that we can only provide general recommendations regarding custom code.
This query should return all the listings that are in the same category and with the same materia…am I wrong? It only match the category in both version
I have other two questions:
I am interested in buying the request plugin and i would like to know if is it possibile to add custom attributes like the phone number and if that attributes can be use as a filter for searching.
The second question reguard using paid listing with the request plugin to ask the user to pay a monthly fee to keep their request online with the packages.
Please try debugging using $query->set_args(), there, you can set the default wp_query parameters and check if the query responds at all.
Yes, you can use the custom attribute filterable for requests, but please note that not all attributes will have this feature, you can test it with the listing attributes before buying, as there is similar functionality for this feature: How to add listing attributes - HivePress Help Center
Unfortunately, there is no package feature for requests.
I tried to use$query->set_args(['categories__in' => $listing->get_categories__id(), 'materia' => $listing->get_materia__id()]) but now doesn’t match both category and materia…
Using the code with query->filter(…) and var_dump with categorie__id and materia__id it return and Array and a String.
So is there a way that a request after a monthly period of time, for example, is no longer visible and the user has to pay to renew it, as if it were a subscription?
I recommend debugging the custom code using error_log and var_dump. If you provide an array of IDs to categories__in using the default ->filter() method of a query, it will be altered for sure. If you use ->set_args() then you have to use the default WordPress API https://developer.wordpress.org/reference/classes/wp_query/#parameters
This way you can check if the method returns any category IDs, or attribute option IDs, or the issue is with the query, etc.