Divi child theme support

Hello,

This software looks really great! Thank you for working on it!

I’m trying to use a Divi child theme with HivePress for a client’s site. Divi doesn’t seem to work very well with it at all by default. I added the hivetheme library with composer and it almost works except it doesn’t load the assets properly, it tries to get them from the parent theme.

I believe I’ve eventually tracked it down to a line in hivepress/hivetheme/includes/class-core.php line 164 where it has get_template_directory_uri() I changed it to get_stylesheet_directory_uri() and it works ok now.

However I’m wondering now how to get the header and footer of DIvi or anything to display. For example when I go to /submit-listing/details/ I can see the form for submitting a listing but there is no header or footer even though in Divi I have created a global header and footer.

I also tried copying all the files from the listinghive theme into this Divi child theme and I don’t even see any header or footer or anything from that there either.

The styles and images do work now at least after changing that other thing but I can’t figure out how to get the header and footer to load.

Do you have any ideas on what I should do? Maybe I’m doing something wrong but I couldn’t find anything anywhere on how to use HivePress with Divi which was kind of surprising. Maybe I should just not use DIvi at all? Maybe HivePress just doesn’t work with it at all? Not sure what else I can use that doesn’t cost a bunch every month or year. I have a lifetime license for Divi that I got many years ago and seems like it almost works. I just can’t figure out the header/footer part and wonder what else I may run into next.

Thank you!

Thanks, I’m glad it’s useful!

Please don’t use the HiveTheme library with third-party themes because it’s a framework meant to manage the whole theme, it’s not required for the HivePress plugin to function. It’s just a helper framework that we developed for ourselves (to develop themes faster), but I guess the Divi theme has its own structure and functions.

There may be minor styling issues with third-party themes and the styles may be pretty basic, but given a few CSS tweaks, it’s possible to integrate HivePress with any theme. Please check this tutorial Integrate your theme with HivePress - Developer Docs

1 Like

Thank you!

I will see if I can figure it out with that info. So far it seems like it isn’t actually working to add the header and footer but I suppose I’ll have to play around and make it work somehow or another.

Hello,

I’ve tracked it down to being related to using a global header/footer in Divi and only specific pages in HivePress not working.

These pages are the submit-listing details page, and some of the account pages including listings, packages, settings, login and I’m sure there are probably other pages that don’t work to show the header and footer.

However, it will show them if I disable the global header/footer in the Divi theme builder, but I can’t do that because then I can’t customize the header and footer with Divi.

It seems to happen when the pages that aren’t registered as having specific types, such as singlular, home, category, tag, taxomony, archive, author, date, 404, search. It only seems to happen with this plugin though which is odd and makes me think it’s something specific with the way it works to show the page but I can’t figure out exactly what to do to fix it yet.

I believe when Divi tries to get the request from the current page it returns a null value because it doesn’t detect one of those page types. It tries to run the ET_Theme_Builder_Request::from_current(); function and since it’s null it won’t be able to find a proper layout to use to render the header. Instead of defaulting to using the global header it seems to be just failing with notices and not showing anything. Perhaps this is really an issue with Divi which wouldn’t really be surprising.

Regardless of which software is the cause of the issue I can’t seem to find a good solution to it yet but wanted to post an update in case its useful to anyone.

Thanks for the detailed feedback, we’ll try to make HivePress compatible with the Divi’s custom header & footer. I guess their header & footer disables the theme ones (header.php and footer.php) and renders these as part of the content - this conflicts with HivePress because it renders its static templates (like the Add Listing one) via the template_incude hook, rendering the theme’s header and footer explicitly.

Thank you! That would be awesome. We will surely be purchasing some extensions if that helps give you some extra motivation lol

Plus I will be sure to purchase some for another client as well since some of those are almost exactly what I’ve been trying to do for way too long with other tools and maybe I can just use HivePress for it. However that site is using Pro by theme.co instead of Divi and it has a similar thing.

Divi support told me that the HivePress “is not using the standards of WordPress to load templates like header and footer. I found the template but it doesn’t look standard:” with this screenshot:

Well I’m not sure if that’s exactly correct but anyway. Something is definitely wrong somewhere with something but I don’t know if their support knows what they’re actually talking about at all.

“Since the template is not the standard one and those pages do not have any ID which also means that they are not standard pages, the issue should be related to the way how the plugin coded. You will need to contact the plugin developers so they can check the issue. Probably, they can suggest how the header and footer can be loaded on those pages, maybe using a hook or any other customization.”

I do know that other plugins work fine. Also I noticed that on one page when not logged in the Account link will take you to /account/login/ and it’s missing header/footer but when logged in and it shows you your listings it’s only missing the header there for some reason. Not sure if that gives any clues at all or is just useless junk.

BTW if you need a test site with either of these themes on it just let me know and I’ll set one up for you.

Thank you for your time!

Thanks, we’ll try to make HivePress 100% compatible with Divi and other page builders.

We try to follow the WordPress API, the header and footer are rendered here hivepress/class-page.php at master · hivepress/hivepress · GitHub HivePress uses the template_include hook to detect if it’s a HivePress page (e.g. account) and renders HTML (the theme header + HivePress content + the theme footer).

Yes, there’s no page ID for each of these pages because they are static templates (we tried to keep it simple so users don’t have to create any pages in WordPress/Pages or keep them like in WooCommerce). WordPress seems to allow registering custom URLs, such URLs can render content but there’s no page ID add_rewrite_rule() | Function | WordPress Developer Resources

1 Like

Hello,

I hope you are well! Do you happen to have any updates on this or anything available for testing or any ideas on what I can modify to make it work? Maybe you’re busy working on a big update =)

Did you require access to those themes I mentioned? Because I can give you access to them if you like. Just let me know. I have extra licenses you could use for testing and whatnot so its perfectly legal and all.

I purchased a couple HivePress extensions awhile back and they seem to work great! Although I suppose maybe that was with a different email than the one on this account this is a masked account I created and it’s different from my PayPal email. But not sure if that matters or not.

I’ll probably have to start modifying things myself pretty soon as I can’t hold off much longer. So if there’s anything I can do to help just let me know =)

Thanks, really appreciate this, we’ll try to add Elementor and possibly Divi integration as soon as possible, but there’s no ETA for this yet. If you’re familiar with WordPress development I recommend following this tutorial to integrate HivePress with third-party themes Integrate your theme with HivePress - Developer Docs Regarding the Divi header/footer editor, this requires further debugging specific to their API.

1 Like

I am awaiting the same issue to be resolved to get my client onboarded on HivePress - I hope to see this resolved for more and more developers to use hivepress.

1 Like

I was playing around for awhile trying different things to figure this out. Eventually I thought since Divi isn’t assigning a layout to the page because it can’t figure out what kind of page it is, why can’t I just trick into thinking it’s a certain kind of page? Maybe it would work as a singular post? That might be the best type of layout to use and makes sense since it’s basically a singular post anyway.

Then after going with that idea for bit I realized I can do exactly that.

In my Divi child theme I have a class for actions and I basically added the code below. This adds HivePress support to the theme. It also forces any page that has hp_route in the query to be a singular post thereby making it display the layout properly through Divi because now Divi will detect the page as having a layout instead of nothing.

I don’t know what other unintended consequences this might have yet but it seems to work so far wherever I’ve tested it so I guess that’s that for now.

<?php

namespace Divichild;

class Actions {

	public function __construct() {
		add_action( 'after_setup_theme', [ __CLASS__, 'add_hivepress_support' ] );
		add_action( 'parse_query', [ __CLASS__, 'parse_query' ], 10, 1 );
	}

	public static function add_hivepress_support() {
		if ( function_exists( 'hivepress' ) ) {
			add_theme_support( 'hivepress' );
		}
	}

	public static function parse_query( $wp_query ) {
		if ( isset( $wp_query->query ) && isset( $wp_query->query['hp_route'] ) ) {
			$wp_query->is_singular = true;
		}
	}

}

2 Likes

Thanks for sharing, this seems to be the only solution if Divi has no support for static pages registered with add_rewrite_rule without an instance in WordPress/Pages.

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