• Resolved praiford

    (@praiford)


    I have this code that I put in the functions.php file and it works as far as giving me the menu under settings and adding the content to the database. I can display the content on the site. The problem is that anytime I click on the store button (Submit button) the screen goes blank and I have to use the back button to get back to the wordpress screen. This also affects everything in the settings menu so any time I make a change in the settings menu, the screen goes blank and I to use the back button to get back to the wordpress screen. The settings are saved to the database. If I take this new code out, everything works. Am I missing something in this code?

    <?php
    add_action(‘admin_menu’, ‘add_important_news_options’);
    function add_important_news_options()
    {
    add_options_page(‘Important News Options’, ‘Important News Options’, ‘manage_options’, ‘functions’,’important_news_options’);
    } ?>
    <?php
    function important_news_options()
    {?>
    <div class=”wrap”>
    <h2>Important News Options</h2>
    <form method=”post” action=”options.php”>
    <?php wp_nonce_field(‘update-options’) ?>
    <p>Important News:
    <input type=”text” name=”ImportNewsid” size=”80″ value=”<?php echo get_option(‘ImportNewsid’); ?>” />
    </p>
    <input type=’checkbox’ name=’Imptnews_settings[Imptnews_checkbox_field_0]’ <?php checked( $options[‘Imptnews_checkbox_field_0′], 1 ); ?> value=’Enable Important News banner’>Enabale Important News Banner
    <p><input type=”submit” name=”Submit” value=”Store Options” /></p>
    <input type=”hidden” name=”action” value=”update” />
    <input type=”hidden” name=”page_options” value=”ImportNewsid,Imptnews_settings” />

    </form>
    </div>

Viewing 1 replies (of 1 total)
  • Thread Starter praiford

    (@praiford)

    Never mind, its working. I think I must have overwritten a semicolon or some other part of the function php code. I restored an original function.php and then add the above code at the top and everything seems to be working fine now. I had tried this in different areas in the function.php file and I think I overwrote something that should not have been overwritten.

Viewing 1 replies (of 1 total)

The topic ‘What is wrong with this?’ is closed to new replies.