• I created a custom form on the home page of wordpress site. I want to get these form value on header for every pages where user go.
    Example: user select his location this selected location show visited pages.

Viewing 1 replies (of 1 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Please use the below code in your header file.

    <form method="post">
                  <input type="text" name="name" value="<?php echo get_option( 'peach_option' ); ?>">
                  <input type="submit" name="submit" value="Save">
              </form>
              <?php
              if(isset($_POST['submit']))
              {
                  $name=$_POST['name'];
    
                  global $wpdb;
                    update_option( 'peach_option', $name );
                }
                ?>

    Let me know incase of any concerns/queries.

Viewing 1 replies (of 1 total)
  • The topic ‘show custom form field value on all pages of wordpress’ is closed to new replies.