WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Calling Array Data (3 posts)

  1. depperson
    Member
    Posted 8 years ago #

    First of all, I know it can be done, but I have no idea how to do it.

    I have a mouseover javascript in my header template that allows the following nifty little display - see http://www.gpc-iphc.org/?page_id=4 and mouseover one of the links available.

    Here's what I need. I want to have the array separate and outside the header.php file, so I don't have to search everywhere to update it. I also need to know how I call that array information from back within the header.php file.

    And if anyone knows how to autopopulate the html links that activate the script/array, that would be cool, too. But just the call function is all I need for now. I can hardcode the links.

    Thanks ppl!

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    Put the text of those links in some other file, call it jslinks.php, for example. Just the messages[x]=... stuff. Or, well, any piece of it you want, really, just move it to the other file.

    Then, in your header.php or wherever you want it to be, do this:
    <?php include("jslinks.php"); ?>

    This pulls in that file's contents right into the place where you put the include. Pretty straightforward, really.

  3. depperson
    Member
    Posted 8 years ago #

    thanks otto, i knew it had to be easy.
    I'll close the thread if all works out.

Topic Closed

This topic has been closed to new replies.

About this Topic