Change the oder of listing_actions_primary block

Hi there,
I am using listhingHive theme and I am trying to make my listing block a combination of jobHive and Listing hive theme. I have applied Jobhive theme on to my site but I dont like the footer on the right so what I am trying to do is remove the footer and add the listing_actions_primary directly to the bottom of the block
I am successfully using this code hide the footer

add_filter(
	'hivepress/v1/templates/listing_view_block',
	function($template){
		
		//hide footer
		return hivepress()->helper->merge_trees(
          $template,
          [
            'blocks' => [
              'listing_footer' => [
                    'type' => 'content',
                  ],	
              ],
		  ],
				
		);
	},
	2000
);

I am using this code to move listing_actions_primary

add_filter(
	'hivepress/v1/templates/listing_view_block',
	function($template){
		
		// Remove location field from current position and take it parameters
		$location_field = hivepress()->template->fetch_block($template, 'listing_actions_primary');
		
		// Add location field to another place.
		return hivepress()->template->merge_blocks(
			$template,
			[
				'listing_container' => [
					'blocks' => [
						'listing_content' => [
							'blocks' => [
								'listing_actions_primary' => $location_field,
							],
						],
					],
				],
			],
				
				
		);
	},
1000
);

I have 2 questions

  1. How do I merge this two codes into one
  2. How do I control the listing_actions_primary block order, I would like it to be at the end of the listing block.

See attached picture of what it looks like

Thanks so much.

Another option to do the same thing is to add a div around the header and the hp-listing-content so I can style it as needed.
Here is what the current listing block html looks like right now

I would like to create the html in the picture below by adding a “div” block around the header and the content (separate from the footer). See pic below.


How can I customize the template to achieve this?

Thanks

Hi,

It seems that the first snippet removes the footer block completely, I don’t recommend doing this because updates and extensions may add some elements to it. Please consider moving blocks instead, or if you want to hide the footer you have to move the attributes and actions outside first. This may work if you set a lower priority for the footer removal snippet relative to other snippets that move the attributes and actions blocks outside.

Adding a wrapper also may be tricky because this would require moving all the elements inside. Please check if some changes are possible via CSS, this is the easiest way. JobHive doesn’t move any blocks but just switches the “flex” direction of the HTML elements with CSS.

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