Query Page Content From Theme Options?

Figured it out myself, for anyone else that needs help here are the two options.. <!–Method 1–> <?php $query = new WP_Query(); $query->query(‘post_type=page&p=’ . of_get_option(‘slide_page1’));while ($query->have_posts()) : $query->the_post(); ?> <?php the_title(); ?> <?php endwhile; wp_reset_query(); ?> <!–Method 2–> <?php $slide1 = of_get_option(‘slide_page1’);?> <?php $loop = new WP_Query( array(‘p’ => $slide1, ‘post_type’ => array(‘post’, ‘page’), )); … Read more

Error: options page not found

The action attribute in the form tag redirects you to the options page. But you also need a hidden field with the plugin slug. Normally its a hidden field that looks like this <input type=”hidden” value=”/wp-admin/options.php?page=[plugin-slug]” name=”_wp_http_referer”> where [plugin-slug] is replaced by your plugin slug.

Is it possible to save more than one image to an option?

You define the setting as an array, however, you over and over reference the same entry slider[images]. $wp_customize->add_section(“slider_images”, array( ‘title’ => “Slider”, ‘description’ => “Choose the images for the slider”, ‘priority’ => ’36’, )); $wp_customize->add_setting(“slider_images”, array( ‘default’ => “”, ‘type’ => “option”, )); $slider_images = get_setting(‘slider_images’); $num_images = 0; if (is_array($slider_images) && ! empty($slider_images)) $num_images … Read more

Getting error to display radio button value in General Settings page

Apart from the isset issue, pointed by Rarst, there’s an error in the sanitization function. esc_attr seems not to work with radio buttons, using esc_sql does the job. You’re also missing the checked state for the buttons: add_filter( ‘admin_init’, ‘myservice_register_function’ ); function myservice_register_function() { register_setting( ‘general’, ‘my_service’, ‘esc_sql’ ); add_settings_field( ‘my_service’, ‘<label for=”service_need”>’.__(‘Do You need … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)