Join our new community forum for support & discussion
Join NowCustomize Page with Listings
-
AuthorPosts
-
Aizen 3 years, 5 months ago
Hi Ihor,
Can you or anyone in the community tell me how I edit the page that has the main listings?
I am a wordpress newb I’m sorry to say. I went into wp admin > pages > all pages > edit page
Then added the text I wanted to appear on the listing page – but it doesn’t appear anywhere on the page :-S
Thanks for all your help and support.
Hi,
When you select a page as a listings page in HivePress/Settings section then it’s content is replaced with the listings page layout. HivePress templates are set using blocks so it’s possible to add any content anywhere on a page, but at the moment it requires a code snippet (as soon as I integrate it with the visual WordPress editor it will be possible to edit any template without code changes). Please let me know where you want to add a custom text and I’ll post a code snippet.
Aizen 3 years, 4 months agoHI Ihor,
Thanks – I would like to input some text on the main listing page, below the search bar but above the listings – it needs to be perfectly centered. Thank you
Please try adding this code to the child theme functions.php file:
add_filter( 'hivepress/v1/templates/listings_view_page', function( $template ) { return HivePress\Helpers\merge_trees( $template, [ 'blocks' => [ 'page_header' => [ 'blocks' => [ 'page_header_content' => [ 'type' => 'content', 'content' => '<p style="text-align:center">custom text here</p>', 'order' => 100, ], ], ], ], ] ); } );
Aizen 3 years, 4 months agoThank you for this. Really appreciated.
What if I wanted to add some custom text to website.com/Account/listings? Could you please help me with the code for that? As I noticed the pages don’t actually exist anywhere either.
Thank you in advance. Will make a donation again end of this month
Sure, this code snippet should work:
add_filter( 'hivepress/v1/templates/listings_edit_page', function( $template ) { return HivePress\Helpers\merge_trees( $template, [ 'blocks' => [ 'page_content' => [ 'blocks' => [ 'custom_page_content' => [ 'type' => 'content', 'content' => 'any custom content here', 'order' => 6, ], ], ], ], ] ); } );
I plan to integrate these templates with the visual WordPress editor so it’ll be possible to edit any layout without code changes.
This is strange, I tried adding the same code and it adds the content above the listings https://www.screencast.com/t/FXbB3httbqF Is there some error message when you add it?
Aizen 3 years, 4 months agoHi Ihor,
I added the code to the functions.php file as below:
<?php // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // Include the core HiveTheme class. require_once __DIR__ . '/includes/class-core.php'; /** * Returns the core HiveTheme instance. * * @return HiveTheme\Core */ function hivetheme() { return HiveTheme\Core::instance(); } // Initialize HiveTheme. hivetheme(); add_filter( 'hivepress/v1/templates/listings_edit_page', function( $template ) { return HivePress\Helpers\merge_trees( $template, [ 'blocks' => [ 'page_content' => [ 'blocks' => [ 'custom_page_content' => [ 'type' => 'content', 'content' => 'Beware Scammers are contacting our members offering paid account upgrades. We will never contact you for this!', 'order' => 6, ], ], ], ], ] ); } );
Aizen 3 years, 4 months agoThe text doesn’t appear anywhere, if I leave the code long enough it eventually breaks the listing page.
I noticed that you added it to the ListingHive functions.php file, please use a child theme instead and you’ll be able to update HivePress and ListingHive without erasing these customizations. Child theme can be created with 1 click using this plugin https://wordpress.org/plugins/child-theme-generator/ Once you generate a child theme this plugin can be removed.
If this issue remains you can send temporary WP access to support@hivepress.io and I’ll check it.
-
AuthorPosts
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.