Adding Logo Text or Image Connection Field in Beaver Themer
Original Feature Requests Was:
Hi Chinmoy,
Not sure if it’s actually possible, but I want to display the logo text/images loaded in customizer by client in a header built with themer.
I could t=do this with ACF or PODs but it is not as user friendly.
I am using the bb-theme so it would make sense to grab logo straight from the customizer.
It was a great idea. So I’m played with Themer and created two new connection fields “Site Logo” & “Logo Text”. In this article I am sharing the complete procedure about it. Please keep in mind that this tutorial will be work on Beaver Builder Theme only.
Creating Logo Text Connection Field
Open the functions.php file of any BB Child theme and add this small PHP snippets at end of the file. Adding new site property “Logo Text” which is coming under “Site” group. getLogoText() function is getting the submitted data from customizer. Heading module is good for this connection field.
Logo Text Connection Field
/** * Logo Text */ FLPageData::add_site_property( 'logo_text', array( 'label' => __( 'Logo Text', 'fl-theme-builder' ), 'group' => 'site', 'type' => 'string', 'getter' => 'getLogoText', ) ); function getLogoText() { $logo_text = apply_filters( 'fl-logo-text', FLTheme::get_setting( 'fl-logo-text' ) ); return $logo_text; }
Creating Site Logo Connection Field
Again open the functions.php file of any BB Child theme and add the following PHP snippets at end of the file. Photo module will be the good option for it. Site Logo connection field is appearing under Site group and getSiteLogo() function is returning the logo image URL.
Site Logo Connection Field
/** * Site Logo */ FLPageData::add_site_property( 'logo', array( 'label' => __( 'Site Logo', 'fl-theme-builder' ), 'group' => 'site', 'type' => 'photo', 'getter' => 'getSiteLogo', ) ); function getSiteLogo() { $logo_image = FLTheme::get_setting( 'fl-logo-image' ); return array( 'url' => $logo_image ); }
Now follow the video