I have a problem displaying the data that I am successfully saving to my database.

function create_input_twitter_option() {
    $options = get_option('global_options_arraykey');
    ?><input type="text" name="global_options_arraykey[twitterid]" value="<?php echo $options['twitterid']; ?>" /><?php

This is what I am putting in my template:

<li class="tweat"><a href="<?php echo get_option("twitterid");?>">Visit our twitter Account</a></li>

However I am not getting the href value that I see in the database.

  • What do you see instead? – s_ha_dum Nov 30 '13 at 1:10

I found a solution!!!

      <li class="tweat">
          <a href="<?php $globalOptions = get_option('global_options_arraykey'); echo $globalOptions['twitterid'];?>">Visit our twitter Account</a>

I got it from this site:
Get Option for an Element in an array - WordPress-Hackers

| improve this answer | |
  • 1
    Thanks for letting us know what worked for you. Please accept your answer to close the question. – Charles Clarkson Nov 30 '13 at 2:06
  • I will be able to accept it in 2 days. Thanks. – Amen Ra Nov 30 '13 at 6:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.