カスタムフィールドについて
 
通知
すべてクリア

カスタムフィールドについて


m.j
 m.j
(@m-j)
Active Member
結合: 11か月前
投稿: 14
Topic starter  

カスタムフィールドを利用したいのですが、「投稿」の設定より、「カスタムフィールド」を有効にしても、カスタムフィールドの編集画面が表示されません。

 

カスタムフィールドの使用方法を教えてください。


引用
m.j
 m.j
(@m-j)
Active Member
結合: 11か月前
投稿: 14
Topic starter  

@xeory_production_team


返信引用
Xeory制作チーム
(@xeory_production_team)
メンバー Admin
結合: 3年前
投稿: 49
 

@m-j 

お問合せありがとうございます。

表示オプションのカスタムフィールドにチェックを入れてもフィールドが表示されないということでよろしいでしょうか。

恐れ入りますが、現在ご利用のテーマ,wordpress,PHPの各バージョン、ご利用のOS、ブラウザをお伺いできますでしょうか。
お手数をお掛け致しますがよろしくお願いいたします。


返信引用
m.j
 m.j
(@m-j)
Active Member
結合: 11か月前
投稿: 14
Topic starter  

@xeory_production_team 

ご返信ありがとうございます。カスタムフィールドにチェックを入れてもフィールドが表示されません。

以下が情報です。

テーマ:xeoryBase
wordpress:6.7.1
PHPバージョン:PHP7.4.33
OS:macOS Sequoia 15.1.1
ブラウザ:Google Chrome

 

また、WordPressデフォルトのテーマに変えると、カスタムフィールドは問題なく表示されます。
This post was modified 1か月前 by m.j

返信引用
Xeory制作チーム
(@xeory_production_team)
メンバー Admin
結合: 3年前
投稿: 49
 

@m-j 

お手数ですが以下修正頂ければ幸いです。

1.lib>admin>init.phpファイルの464行目付近

 remove_meta_box( 'postcustom','post','normal' ); // カスタムフィールド
↓
 //remove_meta_box( 'postcustom','post','normal' ); // カスタムフィールド

2.lib/js/bzb-admin.jsファイルの218行目付近

//表示オプション制御
if($("#post_type").val() == 'page'){

    if($("#page_template").val() == 'default'){
      $("#lp_form-hide").removeAttr("checked");
      $("#lp_form").hide("fast");

      $("#postcustom-hide").removeAttr("checked");
      $("#postcustom").hide("fast");
    }else{
      $("#lp_form-hide").attr("checked");
      $("#lp_form").show("fast");

      $("#meta_metabox-hide").removeAttr("checked");
      $("#meta_metabox").hide("fast");

      $("#cta_metabox-hide").removeAttr("checked");
      $("#cta_metabox").hide("fast");
    }
}else if($("#post_type").val() == 'post'){
      $("#postcustom-hide").removeAttr("checked");
      $("#postcustom").hide("fast");

}else{

}

//表示オプション制御
if($("#post_type").val() == 'page'){

    if($("#page_template").val() == 'default'){
      $("#lp_form-hide").removeAttr("checked");
      $("#lp_form").hide("fast");

      // postcustom のチェック状態を変更しない
      // $("#postcustom-hide").removeAttr("checked");
      // $("#postcustom").hide("fast");
    }else{
      $("#lp_form-hide").attr("checked");
      $("#lp_form").show("fast");

      $("#meta_metabox-hide").removeAttr("checked");
      $("#meta_metabox").hide("fast");

      $("#cta_metabox-hide").removeAttr("checked");
      $("#cta_metabox").hide("fast");
    }
}else if($("#post_type").val() == 'post'){
      // postcustom のチェック状態を変更しない
      //$("#postcustom-hide").removeAttr("checked");
      //$("#postcustom").hide("fast");

}else{

}

各箇所のコメントアウトをお願いいたします。

 

但し、カスタムフィールドを記事側に表示するには、別途ファイルの変更が必要になります。
Xeoryはデフォルトのカスタムフィールドを使用しない前提で作成されたテーマとなっております。
その為、記事側への表示に関しては無料サポート対象外となります為ご了承くださいませ。

お手数をお掛け致しますが、よろしくお願いいたします。

This post was modified 1か月前 by Xeory制作チーム

返信引用
m.j
 m.j
(@m-j)
Active Member
結合: 11か月前
投稿: 14
Topic starter  

@xeory_production_team 

返信ありがとうございます。上記設定したところ、カスタムフィールドの編集画面は表示されました。

しかし、設定を更新(保存)することができません。

対応方法をご教授いただければ幸いです。

This post was modified 1か月前 by m.j

返信引用
共有: