Hide Filter Sidebar on the Listing Pagae

I tried to hide the filter sidebar on the „All Listings“ Page, so that i have more space for the Listings to show.
But when i get it done with CSS, it also hides the right sidebar for the attributes on the listing detail (view) page.

I tried this CSS

/* Disable Sidebar */
.hp-page__sidebar.hp-col-sm-4.hp-col-xs-12.site-sidebar, .hp-widget--listing-filter{
	display: none;
}

.hp-row.hp-listing.hplisting--view-page .hp-page__sidebar.hp-col-sm-4.hp-col-xs-12.site-sidebar{
	display: all
}

So i tried the PHP Snippet to unset the category Filter, but the space on the right is still blocked from the empty DIV. The same, when i tried the Snippet to move the filters to the top of the page.
I feel, i am near to the solution, its just a little piece missing?

add_filter(
	'hivepress/v1/forms/listing_filter',
	function( $form ) {
		unset($form['fields']['_category']);	
		unset($form['fields']['_tags']);
		unset($form['fields']['_attributes']);
		return $form;
	},
	1000
);

Please try this PHP snippet

add_filter(
	'hivepress/v1/templates/listings_view_page',
	function( $template ) {
		return hivepress()->helper->merge_trees(
			$template,
			[
				'blocks' => [
					'listing_filter_container' => [
						'type' => 'content',
					],
				],
			]
		);
	},
	1000
);
1 Like

Well, it works.
But in that way, the space for the sidebar is still there, so that there is no additional space for listings. Instead the left area is just white space.

i think the div is still created, but empty or some kind.

There are two ways to remove this space

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.