Join our new community forum for support & discussion

Join Now

Home Support Themes ExpertHive Moving vendor block to the top

Moving vendor block to the top

  • Author
    Posts
  • namtrandpm

    Hello everyone,

    I am trying to move the vendor block to the top. I have tried inserting the php code below with no luck. Any thoughts?

    <?php
    add_filter(
    ‘hivepress/v1/templates/listing_view_page’,
    function( $template ) {
    return hivepress()->helper->merge_trees(
    $template,
    [
    ‘blocks’ => [
    ‘listing_vendor’ => [
    ‘_order’ => 5,
    ],
    ],
    ]
    );
    }
    );

    yevhen developer

    Please try this PHP snippet instead. Adding priority to filter is solution.

    add_filter(
    	'hivepress/v1/templates/listing_view_page',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'listing_vendor' => [
    						'_order' => 5,
    					],
    				],
    			]
    		);
    	},
    	1000
    );
    namtrandpm

    I have tried inserting that snippet using xyz snippet with no luck. Am I supposed to add the short code to the blog post page?

    namtrandpm

    I figured it out. I just needed to use the code snippets plugin instead of the xyz. Thanks!

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

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.