- This topic has 4 replies, 2 voices, and was last updated 6 years, 2 months ago by
Steve.
-
AuthorPosts
-
-
November 27, 2015 at 7:19 pm #5136
dougsandlinMemberHello,
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;
?>
-
November 28, 2015 at 12:11 am #5137
SteveKeymaster@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?
-
November 28, 2015 at 2:02 pm #5144
dougsandlinMember@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
-
November 29, 2015 at 1:25 pm #5157
dougsandlinMemberHi 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
-
November 30, 2015 at 4:29 pm #5164
SteveKeymaster@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 use
get_option()with Piklist just like you would use it with any other option.Glad you figured it out.
Closing ticket.
-
-
AuthorPosts
- The topic ‘Where does get_option code go?’ is closed to new replies.