Is There a Way to Create a Global Variable Repository
-
This may have a simple answer but I would like to store all the variables I’ve declared ( or cached ) across my theme in a central file and serve then this file globally ( Similar to how
get_header()
,get_footer()
andget_sidebar()
works ).For this particular project, it would be more convenient if the multitude of variables I’ve created across my theme were housed in a central location in lieu of being scattered throughout various theme files.
I’ve tried creating a file called
variables.php
and serving it viaget_template_part
but without success.Is there a idiomatic way of accomplishing this in WordPress?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Is There a Way to Create a Global Variable Repository’ is closed to new replies.