Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

victor_jonsson on "Best way to create a css file dynamically"

$
0
0

Hi there!

What would be the best way to dynamically generate a stylesheet in a theme? I can think of three different solutions:

1) Having a separate file in theme and assume where the file wp-load.php is located and include it like '/../../wp-load.php'.

2) In the file functions.php check if a certain variable is set and if so generate the stylesheet and terminate the script.

3) Register an ajax function and link to the url of the ajax function (not sure if wordpress checks if AJAX-requests is sent with correct request headers).

Is there any other way to accomplish this? I know that the first solution is most straight forward but I consider it to be something of a hack, especially if it exists a "correct" way of doing it.

/ vic


Viewing all articles
Browse latest Browse all 8245

Trending Articles