2018年11月12日月曜日

Advanced Custom FieldsのWysiwyg Editorの値の入力先

Advanced Custom Fieldsでフィールドで投稿タイプをWysiwyg Editorにした場合

Wordpress 標準の投稿の本文入力欄を消して、ACFで独自に本文入力欄を作り、入力した際、値はACFのフィールドに入る。
excerpt(要約)は自動的に作られない。そのため別途excerpt(要約)を実装する必要がある。

2018/11 時点では下記プラグインは不要となっている。
動作は同じで、値の入力先はACFのフィールド。
WordPress:「Advanced Custom Fields」のWysiwygエディタをビジュアルとテキストで切り替えできるようにする方法 | NxWorld https://www.nxworld.net/wordpress/wp-acf-add-wordpress-wysiwyg-editor.html

https://www.advancedcustomfields.com/resources/wysiwyg-editor/
Changelog
Added Visual / Text tabs in version 5.0.0

2018年9月30日日曜日

The Event Calender 日本語翻訳 各所に書いてある「イベント」の表示を別の名前にする

  1. 翻訳ファイル the-events-calendar-ja.poを poeditで開く
  2. 置換 イベント ワークショップ などに変える
    The Event Calender システム表示も変わってしまうので注意。
  3. The Event Calenderのスラッグをworkshops, workshopなどに変える
本体ファイルに手を入れなくて済む。
しかしアップデートすると変わってしまうので差し替える。。

無保証の翻訳ファイル 2019年5月28日版
the-events-calendar-ja.po
the-events-calendar-ja.mo  にリネームする。

カレンダー表示でイベント範囲のリスト表示のときも正しく表示されます。
2019年5月28日
モバイル表示カレンダーの時にfor が翻訳できなかったので修正したが。
翻訳すると表示が逆になってしまう。
それを直すには

[your-theme]/tribe-events/month/mobile.php
15行目を修正する。

2018年9月28日金曜日

The Event Calender 会場情報入力時の順番を変える

会場情報入力時の順番を変える
バージョンアップすると消えるのでコピーする

src/admin-views/venue-meta-box.php:37:付近

<tr class="venue tribe-linked-type-venue-zip">

</tr>

<tr class="venue tribe-linked-type-venue-country">

</tr>
<tr class="venue tribe-linked-type-venue-state-province">

</tr>
<tr class="venue tribe-linked-type-venue-city">

</tr>
<tr class="venue tribe-linked-type-venue-address">

</tr>

参考:https://iida2.com/wordpress-theeventscalendar/#comment-33

2018年3月7日水曜日

Word差し込み印刷:数値の表示形式を直接指定しても反映されないとき

Word差し込み印刷:書式を直接指定しても反映されないとき(3桁区切り他)


Word差し込み印刷:書式を変えたかったので検索

各所ページには

{ MERGEFIELD 価格 \# \\0, }
{ MERGEFIELD 金額 \# "#,##0" }
を直接、差し込みフィールドに書くように説明があります。

しかし、私のWord 2016 には反映されませんでした。

そういうときは、

  1. 差し込みフィールドを右クリック
  2. フィールドの編集を選択
  3. フィールドウィンドウを表示
  4. 最下部のフィールドコードを選択
  5. フィールドプロパティの詳細・フィールドコードに書式を追加する
書式例はほかのサイトにお任せします。エクセルと同じ。
 \@ "ggge年M月d日" 平成n年m月d日
\# "#,##0" 数字の3桁区切り











2018年3月4日日曜日

複数条件で重複連番・重複合計を計算する

顧客リストで複数条件で重複を検出して連番・合計を計算します。

条件は姓 名・郵便番号を使って組み合わせ、同姓同名でも郵便番号(住所)違いの人を検出します
使用・Excel2016

重複を検出して連番・合計を計算する例は、検索すると出てきますが、複数の条件で連番・合計を計算するページはなかった。

重複連番 D2
=COUNTIFS($D$2:D2,D2,$D$2:D2,D2)
=COUNTIFS([姓 名の行・1行目固定],[姓 名],[郵便番号・1行目固定],[郵便番号])
オートフィルで計算したい行までコピーする
1行目を固定しているので、下記のように1行ごとに範囲が増える。すると1行目から、そのセルまでが範囲になるので、数える対象になる。
=COUNTIFS($D$2:D3,D3,$D$2:D3,D3)
=COUNTIFS($D$2:D4,D4,$D$2:D4,D4)

重複合計 E2
=COUNTIFS($B$2:$B$20,B2,$C$2:$C$20,C2)
オートフィルで計算したい行までコピー

下記、F2/G2は&で計算結果を連結したもの。計算セルを使ってよいならそのほうがわかりやすい。

連番/合計 F2
=COUNTIFS($B$2:B2,B2,$C$2:C2,C2)&"/"&COUNTIFS($B$2:$B$20,B2,$C$2:$C$20,C2)

連番/重複/氏名/郵便 G2
=COUNTIFS($B$2:B2,B2,$C$2:C2,C2)&"/"&COUNTIFS($B$2:$B$20,B2,$C$2:$C$20,C2)&"_"&B2&"_"&TEXT(C2,"[<=999]000;[<=9999]000-00;000-0000")
*顧客リストで、その行が数字のみだと個人を判別できないので連結した。

★1、☆10は、同姓同名だが郵便番号が違うことで、個人を検出できている。

★1 平田 裕子  510-0063  1  3  1/3  1/3_平田 裕子_510-0063
☆10 平田 裕子 013-0426  1 3 1/3 1/3_平田 裕子_013-0426

ABCDEFG
番号 姓 名 郵便番号 重複連番 重複合計 連番/合計 連番/重複/氏名/郵便
★1 平田 裕子
510-0063
1 3 1/3 1/3_平田 裕子_510-0063
2 竹中 幸信
921-8812
1 3 1/3 1/3_竹中 幸信_921-8812
3 平田 武士
670-0944
1 3 1/3 1/3_平田 武士_670-0944
4 平田 裕子
510-0063
2 3 2/3 2/3_平田 裕子_510-0063
5 竹中 幸信
921-8812
2 3 2/3 2/3_竹中 幸信_921-8812
6 平田 武士
670-0944
2 3 2/3 2/3_平田 武士_670-0944
7 平田 裕子
510-0063
3 3 3/3 3/3_平田 裕子_510-0063
8 竹中 幸信
921-8812
3 3 3/3 3/3_竹中 幸信_921-8812
9 平田 武士
670-0944
3 3 3/3 3/3_平田 武士_670-0944
☆10 平田 裕子
013-0426
1 3 1/3 1/3_平田 裕子_013-0426
11 竹中 幸信
366-0826
1 2 1/2 1/2_竹中 幸信_366-0826
12 平田 武士
030-0944
1 2 1/2 1/2_平田 武士_030-0944
13 竹田 武裕
034-0013
1 1 1/1 1/1_竹田 武裕_034-0013
14 浜野 彰
381-3205
1 1 1/1 1/1_浜野 彰_381-3205
15 吉野 妃奈
880-0877
1 1 1/1 1/1_吉野 妃奈_880-0877
10 平田 裕子
013-0426
2 3 2/3 2/3_平田 裕子_013-0426
11 竹中 幸信
366-0826
2 2 2/2 2/2_竹中 幸信_366-0826
12 平田 武士
030-0944
2 2 2/2 2/2_平田 武士_030-0944
10 平田 裕子
013-0426
3 3 3/3 3/3_平田 裕子_013-0426

連絡があった人の合計数を数える

D列 重複連番
=COUNTIFS($B$2:B2,B2,$C$2:C2,C2)
の計算結果をもとに
1の数を数える
=COUNTIF(D:D,1)

2回以上連絡があった人の合計数を数える

D列 重複連番
=COUNTIFS($B$2:B2,B2,$C$2:C2,C2)
の計算結果をもとに
2の数を数える
=COUNTIF(D:D,2)
以降 3回以上,4回以上,5回以上...を数える
=COUNTIF(D:D,[3-5])
ここで、=COUNTIF(D:D,">=2")とするのは間違い。
なぜなら、3,4,5 も数えると、同一人物の3,4,5を数えることになる。

参考・協力
http://www.excel.studio-kazu.jp/kw/20180304164301.html

2018年2月11日日曜日

[lightning]List category postsプラグインで投稿の個別記事に投稿リストをLightningと同じデザインで表示する

List category postsプラグインで投稿の個別記事に投稿リストをLightningと同じデザインで表示する

Wordpress テーマ Lightningでの例


投稿の個別記事に、カテゴリ・タグ別で投稿のリストをLightningと同じデザインで表示しました。
LTG コンテンツエリア投稿リスト ウィジェット を流用すれば同じ表示にできるのかもしれませんが。


  • List category postsプラグインを使用します。

https://wordpress.org/plugins/list-category-posts/

module_loop_post_meta.phpを編集して、リスト表示に複数のカテゴリーを表示する方法のコードに変更します。CSSも変更します。

テーマLightningでカテゴリーを複数表示するようにカスタマイズしました

https://usortblog.com/lightning-multiple-categories-2/


  • List category postsプラグインでの操作
themes/lightning_sub/list-category-posts にList category postsプラグインのテンプレートファイル
my_cat_list.phpを作成して下記のコードを書きます。タグも表示したいのですがまだできていません。
<?php
/*
Plugin Name: List Category Posts - Template "Default"
Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
Description: Template file for List Category Post Plugin for WordPress which is used by plugin by argument template=value.php
Version: 0.9
Author: Radek Uldrych & Fernando Briano
Author URI: http://picandocodigo.net http://radoviny.net
*/

/*
Copyright 2009 Radek Uldrych (email : verex@centrum.cz)
Copyright 2009-2015 Fernando Briano (http://picandocodigo.net)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or any
later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
*/

/**
* The format for templates changed since version 0.17.  Since this
* code is included inside CatListDisplayer, $this refers to the
* instance of CatListDisplayer that called this file.
*/

/* This is the string which will gather all the information.*/
$lcp_display_output = '';

// Show the conditional title:
$lcp_display_output .= $this->get_conditional_title();

//Add 'starting' tag. Here, I'm using an unordered list (ul) as an example:
$lcp_display_output .= "<div>";

/* Posts Loop
 *
 * The code here will be executed for every post in the category.  As
 * you can see, the different options are being called from functions
 * on the $this variable which is a CatListDisplayer.
 *
 * CatListDisplayer has a function for each field we want to show.  So
 * you'll see get_excerpt, get_thumbnail, etc.  You can now pass an
 * html tag as a parameter. This tag will sorround the info you want
 * to display. You can also assign a specific CSS class to each field.
*/
global $post;
while ( have_posts() ):
  the_post();

  //Start a List Item for each post:
  $lcp_display_output .= '<article class="media">';
  $lcp_display_output .= '<div>';

  //Post Thumbnail
  $lcp_display_output .= '<div class="postList_thumbnail">';
  $lcp_display_output .= $this->get_thumbnail($post);
  $lcp_display_output .= '</div>';

  $lcp_display_output .= '<div class="media-body">';
  $lcp_display_output .= '<div class="entry-meta">'; 

  //Show date:
  $lcp_display_output .= '<span class="published entry-meta_items">';
  $lcp_display_output .= $this->get_date($post);
  $lcp_display_output .= '</span>';

  // Show category link:
  $lcp_display_output .= '<span class="entry-meta_items entry-meta_items_term">';
  $catlink = $this->get_category_link();
  $lcp_display_output .= substr_replace($catlink, ' class="btn btn-xs btn-primary"', 2, 0);
  $lcp_display_output .= '</span>';

  //Show the title and link to the post:

  $lcp_display_output .= '<h1 class="media-heading entry-title">';
  $lcp_display_output .= $this->get_post_title($post);
  $lcp_display_output .= '</h1></div>';

  //Show comments:
  $lcp_display_output .= $this->get_comments($post);

  //Show date modified:
  $lcp_display_output .= ' ' . $this->get_modified_date($post);

  //Show author
  $lcp_display_output .= $this->get_author($post);

  //Custom fields:
  $lcp_display_output .= $this->get_custom_fields($post);

  /**
   * Post content - Example of how to use tag and class parameters:
   * This will produce:<p class="lcp_content">The content</p>
   */
 /**
  $lcp_display_output .= $this->get_content($post, 'a', 'media-body_excerpt');
*/

  /**
   * Post content - Example of how to use tag and class parameters:
   * This will produce:<div class="lcp_excerpt">The content</div>
   */
  $lcp_display_output .= '<p>';
  $lcp_display_output .= $this->get_excerpt($post, 'a', 'media-body_excerpt');
  $lcp_display_output .= '</p>';

  // Get Posts "More" link:
  $lcp_display_output .= $this->get_posts_morelink($post);

//Pagination
  $lcp_display_output .= '<p>';
  $lcp_display_output .= $this->get_pagination();
  $lcp_display_output .= '</p>';

  //Close li tag
  $lcp_display_output .= '</div>';
$lcp_display_output .= '</article>';
endwhile;

// Close the wrapper I opened at the beginning:
$lcp_display_output .= '</div>';

// If there's a "more link", show it:
$lcp_display_output .= $this->get_morelink();

// Get category posts count
$lcp_display_output .= $this->get_category_count();

$this->lcp_output = $lcp_display_output;

投稿の個別記事に下記のList category postsプラグインのショートコードを自由に書きます。
[catlist name="ongoing" tags="higashi-murayama" category_description="yes" thumbnail="yes" date="yes" dateformat="Y年Fj日" order=asc catlink="yes" excerpt="yes" excerpt_size="280" pagination="yes"  template=my_cat_list]
 ショートコードは1投稿で、カテゴリ・タグ別にいくつも書け、表示する投稿数も指定できるので
投稿にカテゴリ別のリストを下記のように表示できます(カテゴリのON/OFFによる手動でのイベント管理)。
東京で予定中
東京で開催中
東京で開催終了




SWELL|コーポレートサイトでよくある追従バナーを「複数」設置するカスタマイズ

下記のカスタマイズを参考に、複数のバナーを追加します。同投稿では、段落ブロックを一つ配置して、それをCSSで装飾するものでした。 SWELL|コーポレートサイトでよくある追従バナーを設置するカスタマイズ | VOOL 本 […] 投稿元: Microsoft Power Auto...