Support » Everything else WordPress » Change Background Color of one page on website

Viewing 1 replies (of 1 total)
  • Yes, you can do it using Custom Fields. First you will need to open your header.php and insert this code somewhere in between <head></head> codes:

    <?php if (is_single()) {
    $customstyle = get_post_meta($post->ID, 'customstyle', true);
    if (!empty($customstyle)) { ?>
    <style type="text/css">
    <?php echo $customstyle; ?>
    <style>
    <?php }
    } ?>

    Once you have done that you can add a custom field in each post with the name customstyle and add the css codes in there.

    For example if you want the a certain image to have border you can add:

    #body{background:red;}

Viewing 1 replies (of 1 total)
  • The topic ‘Change Background Color of one page on website’ is closed to new replies.