Viewing 4 reply threads
  • Author
    Posts
    • #5136
      dougsandlin
      Member

      Hello,

      I’m following the demo-settings tutorial, and have set up demo-settings.php as instructed.

      I’m not clear, though, on where the following code should go?

      Please advise – thanks very much.

      <?php
      $theme_options = get_option(‘my_theme_settings’);

      $text_field = $theme_options[‘text’];
      $select_field = $theme_options[‘select’];
      $colorpicker_field = $theme_options[‘colorpicker’];

      echo ‘This is a text field’ . $text_field;

      ?>

    • #5137
      Steve
      Keymaster

      @dougsandlin Where do you want to show/use this setting?

      get_option is a WordPress function not a Piklist function.

      If the setting will control something in your then, then the code will probably go there.

      Let us know what you want your setting to do?

    • #5144
      dougsandlin
      Member

      @Steve – Thanks for your reply.

      Currently, I’m just following the tutorial, and saw the code snippet pasted above – and was unclear as to specifically how it would be used.

      My initial goal is to build a Piklist-based theme – and so, I’m intending to replace the general WP functionality with Piklist functionality, per the various options and capabilities listed in the Piklist User Guide.

      I’m currently delving into WordPress development a bit more deeply. I just completed related (PHP, CSS) courses on Code Academy – but admittedly am still at a fairly basic level with WP development, from a code standpoint (I have years of experience as a front-end user / site administrator).

      And so, any additional suggestions you may have, or resources you can point me to, would be much appreciated.

      Thanks again,

      Doug

    • #5157
      dougsandlin
      Member

      Hi Steve,

      Just FYI to anyone else who may be in a similar position (per my question above) – review of the get_option function in the WordPress Codex Function Reference clarified what I needed to know.

      Thanks again,

      Doug

    • #5164
      Steve
      Keymaster

      @dougsandlin– In most cases you can use standard WordPress functions to retrieve and manipulate your data with Piklist. One of the goals Kevin and I had when creating Piklist, was not to force users to learn a bunch of new functions.

      You can useget_option() with Piklist just like you would use it with any other option.

      Glad you figured it out.

      Closing ticket.

Viewing 4 reply threads
  • The topic ‘Where does get_option code go?’ is closed to new replies.