WordPress [Smart Custom Fields]WYSIWYGにフォントサイズボタンを表示させる方法 Smart Custom FieldsのWYSIWYG(ビジュアルエディタ)ツールバーには、初期設定でフォントサイズの変更ボタンがありません。 フォントサイズを変えたい場合は、プラグイン内のeditor-wysiwyg.jsファイルを変更し... 2023.04.30 WordPress
WordPress [WordPress]他の固定ページで使ってるSCFのフィールドを取得 Smart Custom Fieldsで他の固定ページのフィールドを取得 ページID=2のフィールドの表示 <?php $field = SCF::get(カスタムフィールド名,2); echo $field; //テキスト echo nl... 2020.09.26 WordPress
WordPress [WP]Smart Custom FieldsのWYSIWYGでpタグや改行を反映させなかったり反映させたり WYSIWYGでpタグや改行を反映させない <?php echo sanitize_text_field($fields); ?> WYSIWYGでpタグや改行を反映させる <?php echo nl2br($fields); ?> 2020.05.10 WordPress
WordPress [WordPress]Smart Custom Fieldsで値の有無による条件分岐 テンプレートファイル <?php if(get_post_meta($post->ID, 'フィールド名', true)): ?> //値がある場合に表示する内容 <?php echo SCF::get('フィ... 2020.04.25 WordPress
WordPress [Smart Custom Fields]管理画面上の画像の表示サイズを変更する方法 functions.php function add_admin_style() { if ( in_array( get_post_type(), array( 'カスタム投稿名', ) )){ echo ' <style> .smart... 2020.04.10 WordPress
WordPress [Smart Custom Fields]フィールドが空であれば表示させない条件分岐 フィールドが空であれば表示させない条件分岐 <?php $group_field = SCF::get( 'グループ名' ); foreach ( $group_field as $field_name => $field_value) {... 2019.12.20 WordPress
WordPress [WordPress]Smart Custom Fieldsの繰り返しグループで画像情報を出力 SCFの繰り返しグループで画像の出力 <?php $field = SCF::get('グループ名'); foreach ($field as $fields) { $images = wp_get_attachment... 2019.06.04 WordPress
WordPress [WordPress]Smart Custom FieldsのWYSIWYGでショートコードを出力 SCFでのWYSIWYGでショートコードを出力 <?php $field = SCF::get(‘カスタムフィールド名’); echo do_shortcode($field); ?> 2019.01.18 WordPress
WordPress [WordPress]Smart Custom Fieldsのフィールド情報出力まとめ テキスト <?php $field = SCF::get('カスタムフィールド名'); echo $field; //テキスト echo nl2br($field); //改行保持 ?> 画像IMGタグ <?php... 2018.11.08 WordPress