Shakib Taha
asked 7 months ago

At the moment, when a User selects ‘view questions’ – it will show ALL Questions regardless if they are answered or unanswered. 
example:
if you go to https://www.designwall.com/question/
you will see that the default filter is ‘ALL’ and not answered or un-answered etc. 
where do i make changes to enable a different default filter?

1 Answers
DominicStaff
answered 6 months ago

You can use the following code in the functions.php file in your theme: 
http://snippi.com/s/3xctth2

Dominic Staff
replied 6 months ago

Then replace the Filter name in the line 6.

Shakibt
replied 6 months ago

Hey Dominic – thanks for that – Although, trying to look for an alternative and avoid editing something outside the plugin code itself. I think it’s pretty silly to have to edit the theme for a dependency i would expect internal to the plugin framework and set of code. Having reviewed it the set of code and plugin, what you could do is edit inc/filter.php

under the public function prepare_archive_posts, you’re already defining a set number of Arrays – although calling for each argument to be stored in $filter, just pre-define the variable.

So, before going into the switch ( $filter ), add a $filter = ‘resolved’;

in other words, what’s in the snippi link above but within your plugin codeset.

many thanks,

Dominic Staff
replied 6 months ago

At the moment, you should filter and add code outside the plugin. Will save for the plugin update.

Powered by DW Question & Answer Pro