Free Directory, Listing & Classifieds WordPress Plugin 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!

    ihordeveloper

    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?

    ihordeveloper

    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)

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.