Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8082147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:59:28+00:00 2026-06-05T16:59:28+00:00

I wrote a simple plugin which sets some css code using wp_options. It all

  • 0

I wrote a simple plugin which sets some css code using wp_options. It all looks similar like this:

add_action('init','easy_style');

function easy_style()
{
    ?>
    <style>
    #header a {
        color: <?php echo get_option('topcolor'); ?>;
        font-size: <?php echo get_option('topsize'); ?>px;
        <?php
            if (get_option('topstyle') == "bold")
            { echo "font-weight: bold;"; echo "font-style: normal;"; }
            elseif (get_option('topstyle') == "italic")
            { echo "font-style: italic;"; echo "font-weight: normal;"; }
            elseif (get_option('topstyle') == "bolditalic")
            { echo "font-weight: bold;"; echo "font-style: italic;"; }
            else { echo "font-weight: normal;"; echo "font-style: normal;"; }
        ?>;
    }

    </style>
    <?php
}

Now this works, but if I activate my “Contact Form 7” plugin, the contact form 7 doesn’t work anymore. It can’t send any mails. So I think what I do is wrong. If I remove this piece of code, the contact form works again…

I think I do it wrong because the css needs to be loaded in the header, no?
So what I thought I would do as a test is put the same code in the header. However then some other css (i don’t know where) overwrites these, so this also doesn’t work.

I think there are some wp functions to add css code to the header but I don’t know how exacly.

Any ideas?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:59:29+00:00Added an answer on June 5, 2026 at 4:59 pm

    I solved my problem by loading in the styles.css file, edit it and save again

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have wrote this simple plugin which smooth scrolls the browser window and adds
I am trying to write a simple Wordpress plugin, which updates a custom field
I wrote a simple code to capture the netdevice notifications and simply print their
I am using autocomplete plugin in my form. I am using this autocomplete feature
We have some code that must access low level windows XP os calls which
I installed the executor plugin into my Grails app to do some simple asynchronous
I'm trying to implement a simple plugin system which will allow people to write
i wrote simple 3 functions to scrape titles , description and keywords of simple
I wrote simple class that on the start it just increase the value of
I wrote simple load testing tool for testing performance of Java modules. One problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.