Assistance Needed to Edit Listing Page and Add Video Embed Field

Hi HivePress Team,

I’m currently working on a project using the ListingHive theme, and I would like to add a video embed field (for YouTube or Vimeo) to the listing page, specifically after the description box. I’ve created a custom attribute (video_url) for the video link but I’m struggling to locate where the actual Description Box is in the theme’s code to insert this custom field.

If I were using a generic WordPress theme with Elementor Pro, adding a video embed after the description would be straightforward. However, with ListingHive, I’m unable to find the exact template or location in the plugin/theme files where this Description Box is defined so that I can edit it.

Could you please point me to where this field is located in your ListingHive theme or the HivePress plugin? Additionally, I’d like to add some text to the listing page (e.g., a recommendation to compress images into WebP format for better performance) but have been unable to find the template controlling the listing page layout. Since editing via the standard WordPress page editor doesn’t seem to affect this, I assume this layout is handled via templates or a specific file within the plugin or theme.

Any guidance on how to locate and modify these fields (both for the description box and adding text) would be greatly appreciated.

Thanks in advance for your help!

Hi,

The easiest option is to create an Embed attribute in Listings > Attributes and assign it to the Ternary display area. Then, it will appear above the description in full width. But to move it below the description, there are two ways:

  1. Use code snippets if you don’t plan any other changes to the listing page.

  2. Create a template in HivePress > Templates for the listing page, and build it from blocks in the same way as in Elementor, and in any order and with custom content.

​I hope this is helpful to you.

Thank you for the response. I have two questions relating to this issue…

  1. If I use code snippets, what is the location of the , so that I can write the code to go beneath that location? What is the file where the template for a listing is located, so that I can edit that file? This is where I am getting confused because a website visitor sees this link - https://privacyspies.com/travel/the-travel-deal-la-fitness-deal/, but a vendor editing a file sees this link - https://privacyspies.com/account/listings/27/ and they are in different directories?
  2. I did an edit on the main page for Browse Listings, see the attached screenshots, but when I go to the Browse_Listing page it is still pulling the template without any changes. Do I have to create an entirely new template page and rename it?

Hi,

  1. Could you please provide information on whether you have tried to create an Embed attribute? After you create it, a field should appear in the listing form, and if you add a URL (for example, a YouTube video), then after assigning it to the Ternary area, this attribute should appear above the description. As soon as you succeed, let us know and we will provide a PHP snippet to move it under the description.
    Yes, it’s okay that the URLs are different, since the first is the listing page and the second is the editing form, these are different contexts, but the switching takes place in the menu on the listing page.

  2. Most likely, you just created a listing page, not a template for Listings. You need to create a template in HivePress > Templates using this documentation: How to customize templates - HivePress Help Center

Hi Andril,

  1. Yes. Thank you. I’m attaching screenshots of the attribute, it’s embedded and on the ternary page, and it’s working. I dropped in a generic Los Angeles Youtube video to test it. I’m not sure if it will work with a Vimeo or any other type of external video other than Youtube, but it works. I just need the code snippet to drop it beneath that Description, so that it’s not directly under the images like it is now for a better layout. It’s set as an optional field and I’m assuming I could create more than one of these fields to include more than one video?

  2. As far the listing page edits, that is correct. I edited the Listing Page rather than the Template. Is there a way to put the Listing Page that I edited back to normal or duplicate that page and drop it into a new Template? I would like to keep the existing Listing Page and just create another way to showcase listings. Thanks and I’ll follow the “How To” you shared.

Images…




Real quick question. If I don’t want to REPLACE the current listing page by creating a NEW template, can I just add another page with the template features, so that there are more ways to view the listings than just the one page? Would I do this by creating multiple Templates or do I just create NEW pages? Thanks. The How To Screencast says that the Template will replace the current listing page and I am trying to add more ways to display and look at listings.

Do you have this code snippet for the moving of the video beneath the description for me please?

Hi,

Please try using this code snippet:

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

It should move the ternary attribute area below the listing description.

Unfortunately there’s no UI option to create multiple listing page layouts within the same website, it would be possible only by overriding template parts and adding conditional logic to the code (e.g. if the layout depends on the listing category or other criteria).

If you create a template in HivePress/Templates, it overrides the default one (which is defined by the code, while custom Templates are defined by the blocks added to the editor). The downside of using custom templates is that you have to re-build the layout with all the blocks available in the default template, but custom templates are useful if many changes are needed, and you don’t want to use custom code snippets.

Hope this helps

Thank you. That code worked great. I also figured out the limitation of the template situation. I added a View More Listings button for the Browse Listings page and it’s a solution.

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