Join our new community forum for support & discussion

Join Now

Home Support Themes ListingHive Add text to submit-listing/category/ and submit-listing/details/?

Add text to submit-listing/category/ and submit-listing/details/?

  • Author
    Posts
  • justinbryeans

    I’d like to add some simple descriptive text to submit-listing/category/ and submit-listing/details/. Best way to do that? Thanks!

    ihor developer

    At the moment it’s possible only via code snippets, I plan to add integration with Gutenberg in the near future (then all layouts will be visually editable). These code snippets should work:

    add_filter(
    	'hivepress/v1/templates/listing_submit_category_page',
    	function( $template ) {
    		return HivePress\Helpers\merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'page_container' => [
    						'blocks' => [
    							'page_content' => [
    								'blocks' => [
    									'listing_search_form' => [
    										'type'    => 'content',
    										'content' => 'custom text here',
    										'_order'  => 7,
    									],
    								],
    							],
    						],
    					],
    				],
    			]
    		);
    	}
    );
    
    add_filter(
    	'hivepress/v1/templates/listing_submit_details_page',
    	function( $template ) {
    		return HivePress\Helpers\merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'page_container' => [
    						'blocks' => [
    							'page_content' => [
    								'blocks' => [
    									'listing_search_form' => [
    										'type'    => 'content',
    										'content' => 'another custom text here',
    										'_order'  => 7,
    									],
    								],
    							],
    						],
    					],
    				],
    			]
    		);
    	}
    );
    justinbryeans

    That’s great, thanks! Question, how could I add a class to use for styling?

    ihor developer

    If you mean class for this custom content you can wrap it with a “div” tag:

    <div class="custom-class">content here</div>

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.