Change css value with php

后端 未结 3 1789
天命终不由人
天命终不由人 2021-01-03 03:19

how can I change css of a div displaying some text on my home page from the admin are. I want when I enter a color code in my plugin admin page, the code is updated in the c

3条回答
  •  Happy的楠姐
    2021-01-03 04:10

    How I do it is have a content loader controller or script that will load images/css/js and pass them to the browser, you can also control the cache and create javascript dynamically, like the image lists in tinyMCE ect:

    Heres an stripped down example but you get the idea.

    
    

    Then have you css files with place holders replaced by your parameters:

    #div{
    background: #{BACKGROUND} url('{SITE_URL}/stripe.png') repeat;
    }
    

提交回复
热议问题