• Resolved inigo

    (@inigo)


    Hi

    I added some define declarations in function.php, like simple texts which are to be displayed on pages.
    (sort of a language switcher: if russian define this, this if spanish define this, that etc)
    I want to use them in my templatefiles like search.php or footer.php in this way:
    <h1 class=”entry-title”><?php echo CONSTANT; ?></h1>

    Funny thing is the defines do not seem to be available: nothing shows

    What is the proper way?
    How do I get to see my defines?

    thx i.a.
    I

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    you need to tell wordpress that you want a function included in the front-end.
    Here is a lot of info about that.
    But basically you make your defines in a function and then add this:
    add_action('wp_head', 'your_function');
    Hope this helps,
    Regards

    Thread Starter inigo

    (@inigo)

    Thx jnhghy for your quick answer.
    Works like a charm!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘define in functions use in frontend’ is closed to new replies.