Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8483873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:13:35+00:00 2026-06-10T20:13:35+00:00

Hi I am just learning to work with the settings API and I cant

  • 0

Hi I am just learning to work with the settings API and I cant seem to get to sections on the same page to work.The first section works perfetly and saves the daya but the second displays an error on save :

Options Page not Found

This is the code for my entire options page:

<?php
/* ------------------------------------------------------------------------ *
 * REGISTER MENU AND SUBMENU
 * ------------------------------------------------------------------------ */
function thanathos_theme_menu()
{
  add_menu_page('Thanathos',
      'Thanathos',
      'administrator',
      'thanathos_menu_id',
      'thanathos_display'
  );
}

add_action('admin_menu', 'thanathos_theme_menu');

/*------------------------------------------------------------------------ *
* Social & Logo Options
* ------------------------------------------------------------------------ */
function thanathos_initialize_frontpage_options()
{
  if (false == get_option('thanathos_front_page_options')) {
    add_option('thanathos_front_page_options');
  }
  add_settings_section(
      'thanathos_front_page',
      '',
      'thanathos_front_page_section_callback',
      'thanathos_front_page_options'
  );
  add_settings_field(
      'logo_path',
      'Logo Path',
      'thanathos_logo_path_url_callback',
      'thanathos_front_page_options',
      'thanathos_front_page'
  );
  register_setting(
      'thanathos_front_page_options',
      'thanathos_front_page_options',
      'thanathos_front_page_options_sanitize'
  );
}

add_action('admin_init', 'thanathos_initialize_frontpage_options');
function thanathos_front_page_section_callback()
{
}

function thanathos_logo_path_url_callback()
{
  $options = get_option('thanathos_front_page_options');
  echo '<input type="text" id="logo" name="thanathos_front_page_options[logo_path]" value="' . $options['logo_path'] . '" />';
}

function thanathos_front_page_options_sanitize($input)
{
  $output = array();
  foreach ($input as $key => $val) {
    if (isset($input[$key])) {
      $output[$key] = strip_tags(stripslashes($input[$key]));
    }
  }
  return apply_filters('thanathos_front_page_options', $output, $input);
}

/* ------------------------------------------------------------------------ *
* Slider Options
* ------------------------------------------------------------------------ */
function thanathos_front_page_slider_options()
{
  if (false == get_option('thanathos_front_page_slider')) {
    add_option('thanathos_front_page_slider');
  }
  add_settings_section('thanathos_front_page_slider',
      '',
      'thanathos_front_page_slider_callback',
      'thanathos_display',
      'thanathos_front_page_slider'
  );
}

add_action('admin_init', 'thanathos_front_page_slider_options');
function thanathos_front_page_slider_callback()
{
}

/* ------------------------------------------------------------------------ *
 * Display on Thanathos Menu Page
 * ------------------------------------------------------------------------ */
function thanathos_display()
{
  ?>
    <style>
        fieldset {
            border: 1px solid #ddd;
            margin-top: 20px;
            padding-bottom: 20px;
        }

        legend {
            margin-left: 5px;
            padding: 0 5px;
            color: #2481C6;
            text-transform: uppercase;
        }

        p.submit {
            margin-left: 10px;
        }

        td input {
            width: 360px;
        }
    </style>
    <div class="wrap">
        <div id="icon-themes" class="icon32"></div>
        <h2>Thanathos General Options</h2>
      <?php settings_errors(); ?>
        <form method="post" action="options.php">
            <fieldset>
                <legend><strong>Logo and Social Options</strong></legend>
              <?php
              settings_fields('thanathos_front_page_options');
              do_settings_sections('thanathos_front_page_options');
              ?>
            </fieldset>
          <?php submit_button(); ?>
        </form>
        <form method="post" action="options.php">
            <fieldset>
                <legend><strong>Slider Options</strong></legend>
              <?php
              settings_fields('thanathos_front_page_slider');
              do_settings_sections('thanathos_front_page_slider');
              ?>
            </fieldset>
          <?php submit_button(); ?>
        </form>
    </div>
  <?php
}
?>

If this is not the corect approch of adding two sections to the same page then what is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:13:37+00:00Added an answer on June 10, 2026 at 8:13 pm

    Below is an excellent tutorial for the settings api. Altough a bit long if you want to do it as a whole.
    In part 5 it explains why you can’t have 2 settings_sections on one page.
    The solution: use tabs.
    This will help you with your problem.

    http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-1/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just learning C#, radiobuttons and checkboxes. No urgency. The code works to display the
Im just learning SQLite and I can't get my parameters to compile into the
I'm just learning ruby on rails and try to configure it to work on
I'm just learning Git and there is something I can't work out. After creating
Just learning how to work with php and mysql, using CodeIgniter. Running into that
Im just learning javascript and I'm just wondering why this doesn't work. I've created
Sorry this is obviously my first time here, I am just learning how to
I'm just learning to work with partial classes in VB.NET and VS2008. Specifically, I'm
I am just learning to work with csv files from the command line. I
I'm just learning the basics of how triggers work/what the best uses for them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.