Skip to content

Preferred post filtering plugin to use with Timber? #3016

Answered by Levdbas
bobhuf asked this question in Q&A
Discussion options

You must be logged in to vote

in my site class i have a static function with base facets I reuse in multiple blocks. The facetwp_function is just a wrapper by facetwp self to prevent using shortcodes in your theme.

public static function facet_base_filters()
	{
		return [
			'per_page'             => FWP()->facet->pager_args['per_page'],
			'selections'           => facetwp_display('selections'),
			'search'               => facetwp_display('facet', 'search_search'),
			'search_resultsamount' => facetwp_display('facet', 'search_resultsamount'),
			'pagination'           => facetwp_display('facet', 'search_pagination'),
		];
	}

Then in my block controller:

	public function block_context($context): array
	{
		$type  = $t…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jameelmoses
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Levdbas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants