Free Directory, Listing & Classifieds WordPress Plugin Support Themes ListingHive Change content on listing detail view

Change content on listing detail view

  • Author
    Posts
  • sbroways

    Hi,
    Is there any way to edit the order of content on the listing detail? I’d like to move the description above the images, for example. Possible move the custom attributes below the description as well. (Right now they are showing above the description.)

    I was also planning on updating the template to pull in an image for the hero on the listing detail similar to what you have on the home and category pages.

    I think I saw some re-ordering capabilities via your hooks, but looking to make bigger changes than that I believe.

    Thanks! The whole theme and plug-in are fantastic. Well done.

    ihordeveloper

    Thanks!

    You can re-order any template parts via “hivepress/v1/templates/$template_name” filter. If you’re familiar with PHP you can start with this code snippet:

    add_filter(
    	'hivepress/v1/templates/listing_view_page',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'listing_attributes_secondary' => [
    						'_order' => 123,
    					],
    
    					'listing_description'          => [
    						'_order' => 123,
    					],
    				],
    			]
    		);
    	}
    );

    And change 123 to match the desired order. You can insert new template parts using the same filter, here’s a directory that contains all templates (for checking the block names and orders) https://github.com/hivepress/hivepress/tree/master/includes/templates

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

You must be logged in to reply to this topic.

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.