Viewing 3 reply threads
  • Author
    Posts
    • #7160
      Ico
      Member

      Hi;
      I’m creating a custom WP theme for a client, and I have a strange problem. They have specific front-page template that I’m implementing in front-page.php. I’m adding Editor fields to the front-page template as follows :

      /*
      Title:  Front Page Settings
      Template: front-page
      */
      
      piklist('field', array(
          'type' => 'editor',
          'field' => 'home_slogan',
          'label' => 'Homepage Slogan',
          'help' => 'The slogan that shows over homepage main image',
          'options' => array(
              'wpautop' => true,
              'teeny' => false,
              'quicktags' => true
          )
      ));
      

      The field is visible the backend. The first time I try to update it it records the proper value. After this, if I modify the field and try to save it, it stays with the first recorded value. I set the wp_debug to true, but nothing shows up.

    • #7161
      Ico
      Member

      Update:

      After creating a custom page template ( page-customhomepage.php ) and assigning it as a “homepage”, the meta is not updating again.

    • #7175
      Steve
      Keymaster

      @bassta– If you remove the TEMPLATE parameter does the field save properly?

    • #7187
      Ico
      Member

      It turned out to be issue with not removing the support for pages, but just for posts. After adding remove_post_type_support(‘page’, ‘custom-fields’); everything worked properly.

Viewing 3 reply threads
  • The topic ‘Fields not updating if added for front-page template.’ is closed to new replies.