当我遇到CSS部分时,遵循教程,Wordpress网站似乎对我在CSS代码中所做的更改没有反应。我会发布我的内容:
// file abraham-admin.php
<h1>Abraham Theme Options</h1>
<?php settings_errors(); ?>
<?php
$firstName = esc_attr( get_option( 'first_name' ) );
$lastName = esc_attr( get_option( 'last_name' ) );
$fullName = $firstName . ' ' . $lastName;
$description = esc_attr( get_option( 'user_description' ) );
?>
<div class="abraham-sidebar-preview">
<div class="abraham-sidebar">
<h1 class="abraham-username"><?php print $fullName ?></h1>
<h2 class="abraham-description"><?php print $description ?></h2>
<div class="icons-wrapper">
</div>
</div>
</div>
<form method="post" action="options.php" class="abraham-general-form">
<?php settings_fields( 'abraham-settings-group'); ?>
<?php do_settings_sections( 'z_abraham'); ?>
<?php submit_button(); ?>
</form>
// file enqueue.php
function abraham_load_admin_scripts() {
wp_register_style('abraham_admin', get_template_directory_uri() . '/css/abraham_admin.css', array(), '1.0.0', 'all');
wp_enqueue_style('abraham_admin');
}
add_action( 'admin_enqueue_scripts', 'abraham_load_admin_scripts');
// file abraham_admin.css
.abraham-general-form,
.abraham-sidebar-preview { display: inline-blog; float: left; }
.abraham-sidebar-preview { width: 200px; background-color: #3f3f3f; padding: 20px; text-align: center; margin-right: 20px}
.abraham-sidebar { display: block; text-align: center; }
h1.abraham-username,
h2.abraham-description { font-weight: 100; color: #ffffff; }
h1.abraham-username { font-size: 24px; margin: 0 0 10px; }
h2.abraham-description { font-size: 13px; margin: 0 0 20px; }
感谢任何帮助。谢谢!