Hey team,
I’m creating a plugin but to be honest, I dont know what I’m doing, I’m just doing what chatgpt tells me.
I’ve never used css, so that probably a bad start.
I have a plugin folder, with a main php file, then an includes, css, and js folder
this is the css that i’m trying to get to work (I’ve tried it with and without the from#):
form#add_property_form {
max-width: 288px !important;
margin: 0 auto;
}
form#add_property_form label,
form#add_property_form input {
display: block;
margin-bottom: 10px;
}
form#add_property_form input[type=”text”],
form#add_property_form input[type=”date”],
form#add_property_form input[type=”number”] {
width: 50%;
box-sizing: border-box;
}
I’ve also added debug lines that show
[02-Jul-2023 22:20:25 UTC] Style is registered
[02-Jul-2023 22:20:25 UTC] Style is enqueued
however, my input fields still span across 100% of the whole page,
all i’m trying to do is get it to show:
label: input field (of around 250px)
label: input field
label: input field
and so on
this is how i’m trying to call the css:
function load_portfolio_tracker_styles() {
$style_url = plugin_dir_url( __FILE__ ) . ‘css/portfolio_tracker_style_new.css’; // Update filename here
error_log(‘Style URL: ‘ . $style_url);
wp_register_style( ‘portfolio_tracker_style’, $style_url, array(), ‘1.0’ );
if (wp_style_is(‘portfolio_tracker_style’, ‘registered’)) {
error_log(‘Style is registered’);
} else {
error_log(‘Style is not registered’);
}
wp_enqueue_style( ‘portfolio_tracker_style’ );
if (wp_style_is(‘portfolio_tracker_style’, ‘enqueued’)) {
error_log(‘Style is enqueued’);
} else {
error_log(‘Style is not enqueued’);
}
}
add_action( ‘wp_enqueue_scripts’, ‘load_portfolio_tracker_styles’ );
my latest test, was to add a child theme, but that doesn’t seem to have worked either.
anyone able to lend a hand?