Join our new community forum for support & discussion

Join Now

Home Support General HivePress Make listings appear 3 per row in front page

Make listings appear 3 per row in front page

  • Author
    Posts
  • Maskari

    Hi, How can I make listings appear in three columns per one row? currently, it appears in two columns.

    This is the link: http://faisala48.sg-host.com/services/

    Maskari

    Correction: not front page, I meant front-end.

    Thanks

    yevhen developer

    It’s possible, but requires some CSS tweaks since 3 listings may not fit into the current page width. Please try starting with this code snippet:

    add_filter(
    	'hivepress/v1/templates/listings_view_page',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'listings' => [
    						'columns' => 3,
    					],
    				],
    			]
    		);
    	}
    );
    Joe

    Please how do I reverse the 3 column snippets code to the original format.

    I used this code and the column changed to 3 but the text arrangement on the layout was not accurate. I deactivated the code, even deleted it but it still remained 3 column.

    this is the code I used

    add_filter(
    	'hivepress/v1/templates/listing_submit_category_page',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'listing_categories' => [
    						'columns' => 3,
    					],
    				],
    			]
    		);
    	},
    	1000
    );
    yevhen developer

    Please make sure that your site is not cached and that you view the Select Category page of the listing submission process, this code affects the Select Category page only (it doesn’t affect categories on the home page).

    tech.caries

    how to add this snippets code?

    ihor developer

    Please check this page https://help.hivepress.io/article/23-how-to-add-custom-code-snippets

    tech.caries

    done..but nothing change.. it’s not work

    ihor developer

    Please make sure that you use it to add PHP (not CSS) snippets. If you add a snippet suggested above, it’ll set the number of columns to 3 on the Select Category page of the listing submission (you can change it to 2 or 4).

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

You must be logged in to reply to this topic.