Created
May 22, 2014 10:55
-
-
Save rodica-andronache/01d2f6a478a91cd8a80e to your computer and use it in GitHub Desktop.
Variabile PHP in cod css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wp_register_style( 'zerif_php_style', get_template_directory_uri() . '/css/style.php'); | |
| wp_enqueue_style( 'zerif_php_style' ); | |
| intr-un fisier style.php pe care il includ in functions: | |
| <?php | |
| include_once "../../../../wp-load.php"; | |
| header("Content-type: text/css"); | |
| $zerif_bg = get_theme_mod('zerif_bg'); | |
| if(isset($zerif_bg) && $zerif_bg != ""): | |
| ?> | |
| body.home { | |
| background:url(<?php echo $zerif_bg; ?>) !important; | |
| } | |
| <?php | |
| endif; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment