Adapting Geodirectory to beaverbuilder child theme

Hi, I’m relatively new to bb and have searched the forums without much luck (could be my terms).

I’m attempting to integrate wpgeodirectory with my bb child theme. I’m currently following this guide :http://docs.wpgeodirectory.com/how-to-build-your-own-theme-compatibility-plugin/

However, when I replace the classes with some of the beaverbuilder classes, the content still seems to span the whole width of the page v.s being fixed. What am I missing?

<?php
/*
Plugin Name: GeoDirectory compat
Plugin URI: http://localhost/dev
Description: none
Version: 1.0.0
Author: M33
Author URI: http://localhost/dev
 
*/

// BECAUSE THIS PLUGIN IS CALLED BEFORE GD WE MUST CALL THIS PLUGIN ONCE GD LOADS
add_action( 'plugins_loaded', 'geodir_mytheme_action_calls', 10 );
function geodir_mytheme_action_calls(){
	
	/* ACTIONS
	****************************************************************************************/
	
	// WRAPPER OPEN ACTIONS
	remove_action( 'geodir_wrapper_open', 'geodir_action_wrapper_open', 10 );
	add_action( 'geodir_wrapper_open', 'geodir_mytheme_action_wrapper_open', 9 );
	
	// WRAPPER CLOSE ACTIONS
	remove_action( 'geodir_wrapper_close', 'geodir_action_wrapper_close', 10);
	add_action( 'geodir_wrapper_close', 'geodir_mytheme_action_wrapper_close', 11);
	
	// WRAPPER CONTENT OPEN ACTIONS
	remove_action( 'geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10 );
	add_action( 'geodir_wrapper_content_open', 'geodir_mytheme_action_wrapper_content_open', 9, 3 );
	
	// WRAPPER CONTENT CLOSE ACTIONS
	remove_action( 'geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10);
	add_action( 'geodir_wrapper_content_close', 'geodir_mytheme_action_wrapper_content_close', 11);
	
	// SIDEBAR RIGHT OPEN ACTIONS
	remove_action( 'geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10 );
	add_action( 'geodir_sidebar_right_open', 'geodir_mytheme_action_sidebar_right_open', 10, 4 );
	
	// SIDEBAR RIGHT CLOSE ACTIONS
	remove_action( 'geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10 );
	add_action( 'geodir_sidebar_right_close', 'geodir_mytheme_action_sidebar_right_close', 10, 1 );
	
 
} // Close geodir_mytheme_action_calls
 
/* FUNCTIONS
****************************************************************************************/
 
// All the functions we replaced above will go here

// WRAPPER OPEN FUNCTIONS
// WRAPPER OPEN FUNCTIONS
function geodir_mytheme_action_wrapper_open() {
	echo '<div class="fl-builder-content">';
}
 
// WRAPPER CLOSE FUNCTIONS
function geodir_mytheme_action_wrapper_close() {
	echo '</div>';
}
 
// WRAPPER CONTENT OPEN FUNCTIONS
function geodir_mytheme_action_wrapper_content_open($type='',$id='',$class='') {
	echo '<div class="fl-row fl-row-fixed-width fl-row-bg-none">';
}
 
// WRAPPER CONTENT CLOSE FUNCTIONS
function geodir_mytheme_action_wrapper_content_close() {
	echo '</div>';
}
 
// SIDEBAR RIGHT OPEN FUNCTIONS
function geodir_mytheme_action_sidebar_right_open($type='',$id='',$class='',$itemtype='') {
	echo '<aside id="my-sidebar-wrapper">';
}
 
// SIDEBAR RIGHT CLOSE FUNCTIONS
function geodir_mytheme_action_sidebar_right_close($type='') {
	echo '</aside>';
}

My site is under development locally. Your help is appreciated.

Hi Mikiah,

Thanks for posting! It looks like you’re using Beaver Builder plugin classnames when you probably should be using the theme’s classnames. It’s hard to say without testing, but you might try the following…

// WRAPPER OPEN FUNCTIONS
function geodir_mytheme_action_wrapper_open() {
	echo '<div class="fl-page-content"><div class="container">';
}

// WRAPPER CLOSE FUNCTIONS
function geodir_mytheme_action_wrapper_close() {
	echo '</div></div>';
}

// WRAPPER CONTENT OPEN FUNCTIONS
function geodir_mytheme_action_wrapper_content_open($type='',$id='',$class='') {
	echo '<div class="row"><div class="fl-content fl-content-left col-md-9">';
}
 
// WRAPPER CONTENT CLOSE FUNCTIONS
function geodir_mytheme_action_wrapper_content_close() {
	echo '</div></div>';
}
 
// SIDEBAR RIGHT OPEN FUNCTIONS
function geodir_mytheme_action_sidebar_right_open($type='',$id='',$class='',$itemtype='') {
	echo '<div class="fl-sidebar fl-sidebar-right col-md-3">';
}
 
// SIDEBAR RIGHT CLOSE FUNCTIONS
function geodir_mytheme_action_sidebar_right_close($type='') {
	echo '</div>';
}

Let me know how it goes!

Justin

Wow, that worked perfectly. Awesome support. I moved from divi and just upgraded to agency last week and haven’t been disappointed. One more question, and I realize this may be out of scope for your forum but since geodirectory doesn’t have shortcodes yet and the widgets cause beaver pagebuilder to completely freeze up, here it is;

I want the map to be full screen but the content to be fixed in the 12 column grid. How would I go about that?

The map seems to be wrapped in the highlighted div in this screenshot: map

Hi Mikiah,

That’s great! I’m glad that worked.

In order to get the map full width, you’ll need to make the content wrappers full width. I’m not sure off the top of my head exactly what CSS you’ll need but this might get you going in the right direction…

.container { width: auto !important; }

After doing that everything will be full width, so you’ll need to manually set widths of the other elements on the page.

If you want, you can send me a temporary login and I can look into why the widgets are freezing up in the builder.

Justin

[Content Hidden]

Thanks, Mikiah. I tried the login but it’s not working. Can you double check?

[Content Hidden]

Hey Mikiah,

My apologies for the delay. I got a bit tied up today. I visited the URL to log my IP and tried logging in to wp-admin with no luck. Let me know if you can get me in.

Justin

[Content Hidden]

Thanks, that worked! I’m checking it out now.

Justin

[Content Hidden]

It’s this one, in particular: https://wordpress.org/plugins/bp-profile-widget-for-blogs/

It could just be the code not being up to standard. Let me know what you think and thanks for the great support.

Thanks. I’ll have a look at that and get back to you.

Justin

Hi Mikiah,

I did some research and it looks like the issue with that widget is that it’s using the function “wp_dropdown_roles” which is only defined in the admin environment. Since it’s trying to call it on the front-end, a fatal error is being thrown causing the widget to bug out.

The author could circumvent this by adding the following code before that call…

require_once 'wp-admin/includes/template.php';

Unfortunately, there isn’t much we can do here as the builder’s rendering code needs to run on the front-end as we’ve found many shortcodes and widgets won’t render in the admin environment because they are checking for is_admin() before doing that. Contact Form 7 is a good example of that.

Sorry I can’t be of more help here!

Thanks,
Justin