Unyson icon indicating copy to clipboard operation
Unyson copied to clipboard

How to include style.php?

Open GreenLightSM opened this issue 8 years ago • 3 comments

Hi, i need to include "style.php" and get varriable from customizer. I connected "style.php", but when i'm trying to get varriable: "$first_color = fw_get_db_customizer_option('bg-color-1');", i have an error: "Fatal error: Call to undefined function fw_get_db_customizer_option()". How can i fix it? Thank you!

GreenLightSM avatar Jun 14 '18 10:06 GreenLightSM

I gave you a solution here: https://github.com/ThemeFuse/Unyson/issues/3443 It is working I tested:

function _action_theme_after_setup_theme() {

	include(get_template_directory() . '/test.php');
}
add_action( 'after_setup_theme', '_action_theme_after_setup_theme', 11 );

File test.php code:

<?php

$first_color = fw_get_db_customizer_option('bg-color-1', 'test');
fw_print($first_color);

ViorelEremia avatar Jun 15 '18 14:06 ViorelEremia

@ViorelEremia Thank you!

GreenLightSM avatar Jun 16 '18 20:06 GreenLightSM

@ViorelEremia How can I include this varriable to css?

GreenLightSM avatar Jun 16 '18 20:06 GreenLightSM