For some reason, I am battling to make sense of everything. This is my code on paste bin: http://pastebin.com/dJxGS6x6

I want to be able to retrieve the options that are saved in the fields. This does not return anything:

<a href="<?php echo get_option('contact_details_vimeo_render'); ?>" target="_blank">
    <i class="fa fa-vimeo" aria-hidden="true"></i>

I basically want to be able to retrieve the stored data as desired.

  • And you are sure that the data is stored in the options table?
    – Robbert
    Commented Jan 12, 2017 at 14:54
  • @Robbert – yes I am sure. This is what's stored a:6:{s:25:"contact_details_telephone";s:14:"+27 21 999 9999";s:19:"contact_details_fax";s:14:"+27 21 999 9999";s:21:"contact_details_email";s:16:"[email protected]";s:28:"contact_details_facebook_url";s:0:"";s:23:"contact_details_twitter";s:0:"";s:32:"contact_details_textarea_field_5";s:80:"Adderess Line1, Address Line2, 8001, Cape Town, South Africa ";}
    – user23355
    Commented Jan 12, 2017 at 15:03
  • This is a serialized option. You need to unserialize it to get your option.
    – Robbert
    Commented Jan 12, 2017 at 15:12

2 Answers 2


Because your options are stored in one overarching serialized option, you have to make a function like below to retrieve the right option.

function get_contact_details_setting( $option ) {
   $contact_details_settings = unserialize( get_option( 'contact_details_settings' ) );
   return $contact_details_settings[$option];

Clearly I wasn't thinking :-(

Since all my options/settings are wrapped in a function that's how I need to retrieve them.... Do you get it? Using the function (I mean... hello!).

Rough code: $x = contact_details_telephone_render(); echo $x;

That will display the telephone number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.