Free Directory, Listing & Classifieds WordPress Plugin Support General HivePress Change default page of select package

Change default page of select package

  • Author
    Posts
  • APES

    Hello once again.
    I want to change the page where “Select Package” for listing shows. Currently mine is showing on my default blog page. Is the a way to create a custom page for this purpose?
    Thanks.

    ihordeveloper

    This would require code customizations (if you mean changing the page layout), if you want to add some custom content it’s possible via HivePress API https://hivepress.io/support/topic/listing-layout/#post-3981 Please consider using the official ListingHive theme, then there will be the full-width layout for the listing submission pages (like on the demo site https://demo.hivepress.io/).

    APES

    Thanks for the response. But actually want to change the page the “Select Package” lands on (no extra layout changes. just change the page from the default to my own).

    ihordeveloper

    It’s not easy to switch it because it’s built into the listing submission process, but you can try to use this code snippet:

    add_filter(
    	'hivepress/v1/templates/listing_submit_package_page',
    	function( $template ) {
    		$page = get_page_by_path( 'select-package' );
    
    		if ( $page ) {
    			$template = hivepress()->helper->merge_trees(
    				$template,
    				[
    					'blocks' => [
    						'page_content' => [
    							'type'    => 'content',
    							'content' => apply_filters( 'the_content', $page->post_content ),
    						],
    					],
    				]
    			);
    		}
    
    		return $template;
    	}
    );

    Then if you create a page with “select-package” URL slug, its content will replace the “Select Package” page content, so you can add any custom content instead.

    APES

    Thanks for the code. The code works but unfortunately, the packages i have created don’t appear at all.
    Is there a way to still have the created packages but on a different page?

    ihordeveloper

    There’s no listing packages block (yet), but you can try using this code snippet instead to add custom content before the packages, without hiding them:

    add_filter(
    	'hivepress/v1/templates/listing_submit_package_page',
    	function( $template ) {
    		$page = get_page_by_path( 'select-package' );
    
    		if ( $page ) {
    			$template = hivepress()->helper->merge_trees(
    				$template,
    				[
    					'blocks' => [
    						'page_content' => [
    							'blocks' => [
    								'custom_content' => [
    									'type'    => 'content',
    									'content' => apply_filters( 'the_content', $page->post_content ),
    									'_order' => 9,
    								],
    							],							
    						],
    					],
    				]
    			);
    		}
    
    		return $template;
    	}
    );
Viewing 6 posts - 1 through 6 (of 6 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.