Setting up a members area

I’m in the process of establishing a members site. You can find a bunch of premium plugins to pay for…and a few free ones like s2member, Membership lite or Members. I decided to go with Members and write everything else i need (like paypal integration and so on) myself.

Need help understanding/coding with Settings API

You have some of the callback functions and the ID’s mixed up, try this: add_action(‘admin_init’, function() { register_setting(‘elem_opts’, ‘elem_opts’, ‘elem_validate_opts’); add_settings_section(‘elem_opts_form1’, ‘Elements Theme Options’, ‘elem_opts_form’, ‘elem_opts’); add_settings_field(‘elem_opts_form’, ‘Facebook’, ‘elem_opts_social_fb_cb’, ‘elem_opts’, ‘elem_opts_form1’); }); function elem_opts_social_fb_cb() { $opts = get_option(‘elem_opts’); if (empty($opts) || !is_array($opts)) { $opts = array(); } ?> <input type=”text” name=”elem_opts[fb]” value=”<?php echo $opts[‘fb’] ? … Read more

Display user HTML on website

You may need to un-escape the output. Take a look at html_entity_decode or similar functions before outputting to the screen. $orig = “I’ll \”walk\” the <b>dog</b> now”; $a = htmlentities($orig); $b = html_entity_decode($a); echo $a; // I’ll &quot;walk&quot; the &lt;b&gt;dog&lt;/b&gt; now echo $b; // I’ll “walk” the <b>dog</b> now html_entity_decode function MKWD_Display_Westmor_Bottom_Left() { $westmor_customers_options = … Read more

Theme option : having the ability to select among several predefined headers

So first you need customizer options. You can put this in customizer.php and include that file in your functions.php or you can just put it in functions.php directly. add_action(‘customize_register’, ‘mytheme_customize_register’); function mytheme_customize_register( $wp_customize ) { /** ———————————————————— SECTION: Header ———————————————————— **/ $wp_customize->add_section(‘section_header’, array( ‘title’ => esc_html__(‘Header’, ‘mytheme’), ‘description’ => esc_attr__( ‘Choose one of three different … Read more

Outputting results from select box option in options panel

I use the same options framework plugin and this is how I specify a select menu using this framework; $test_array = array( ‘one’ => __(‘One’, ‘options_framework_theme’), ‘two’ => __(‘Two’, ‘options_framework_theme’), ‘three’ => __(‘Three’, ‘options_framework_theme’), ‘four’ => __(‘Four’, ‘options_framework_theme’), ‘five’ => __(‘Five’, ‘options_framework_theme’) ); $options[] = array( ‘name’ => __(‘Select a Tag’, ‘options_check’), ‘desc’ => __(‘Passed … Read more

Two Ways Of Creating WordPress Options Pages

I would strongly recommend following the Theme Review guidelines for Theme Settings and Data Security. (If you intend for your Theme to be hosted in the WPORG repository, you will be required to follow these guidelines. Here’s a brief summary: Themes are required to prefix all options, custom functions, custom variables, and custom constants with … Read more