How can I append blog_id to ... echo [functions-defined-constant]?
I use 'constants' a lot. I set them in functions.php like define('mytheme_town', 'Orlando');
and then call them into the theme ?php echo mytheme_town ; ?
.
It's simple and easy. But I need them to be site-specific (for multisite) so I thought it might be possible to append the current blog_id to the theme call and declare constants for each MultiSite in functions.php? I don't know how to code that, but what I'm trying to achieve in the theme file this ... ?php echo [current_blog]_mytheme_town ; ?
.....
For example
In functions.php // set constants for all multisites that use this theme
// awebsite.org : site_id=1
define('1_mytheme_town', 'Orlando');
define('1_mytheme_subject', 'food');
define('1_mytheme_p1', 'This is the first paragraph text');
// adifferentsite.com: site_id=2
define('2_mytheme_town', 'New York');
define('2_mytheme_subject', 'wine');
define('2_mytheme_p1', 'This is the first paragraph text');
// anothersite.net : site_id=3
define('3_mytheme_town', 'LA');
define('3_mytheme_subject', 'Donuts');
define('3_mytheme_p1', 'This is the first paragraph text');
In theme files Call the constants using the current blog_id like so ...
?php echo [current_blog]_mytheme_town ; ?
?php echo [current_blog]_mytheme_subject ; ?
?php echo [current_blog]_mytheme_p1 ; ?
I have been trying all day, but I'm just guessing and I don't really know what I am doing. Everything I have tried works, but it simply echos out text of the code
1_mytheme_town
and not the constant that is defined in functions.php.
Hope you understand what I'm trying to explain.