Home Support General HivePress How I can display 4 categories in one row (select category)

How I can display 4 categories in one row (select category)

  • Author
    Posts
  • inzerat

    Home > Category > Select category

    serhii developer

    Please, try using the PHP snippets suggested in this topic – https://hivepress.io/support/topic/number-of-categories-in-add-listing-frontend/#post-5353

    inzerat

    Hi. Thank you for answer. But there is no answer to your link.

    I need it to appear in a subcategory. On the homepage I have the category Cars. Someone clicks and it goes into the car category. But there are still X subcategories in that category, such as tires, car parts, etc. And these subcategories with pictures are shown 3 in a row, but I want 4.

    ihor developer

    Please try using the same snippet from the suggested topic, but with the hivepress/v1/templates/listing_categories_view_page hook.

    inzerat

    Hi thank you and for Related Listings? 4 in row?

    inzerat

    hivepress/v1/templates/* ???

    ihor developer

    This one should do it: hivepress/v1/templates/listing_view_page with “related_listings” instead of “listing_categories”.

    inzerat

    @ihor Excelento!!! Thank you very much

    inzerat

    Hello, why if I enter the number 5, 6 is displayed on one line? some bug? 5 is not working?

    inzerat
    add_filter(
    	'hivepress/v1/templates/listing_categories_view_page',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'listing_categories' => [
    						'columns' => 5,
    					],
    				],
    			]
    		);
    	}
    );
    ihor developer

    Should work for 6 columns, but listings may not fit in 1/6 of the site width. There are limitations for the CSS grid, it’s based on the 12-column layout.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.