[closed] Change Background Color of one page on website (2 posts)

  1. bella62
    Posted 1 year ago #

    Hello, I am very new to using wordpress. I am using the SimpleChild Theme.

    Is there a way for me to change the background color of just 1 page on my website. If so, step by step instructions would be very much appreciated.

    [please continue with your original topic at https://wordpress.org/support/topic/how-do-i-change-the-color-of-just-1-page-on-my-website?replies=4 ]

  2. Hardeep Asrani
    Posted 1 year ago #

    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; ?>
    <?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:


Topic Closed

This topic has been closed to new replies.

About this Topic