翻訳したくない箇所にCSS追加
リンクなどは不可。
でも不可
class="notranslate"
※カラーミーショップなどECサイトでは、JSで戻すしかない。
function changeLocation() {
window.location.href = "URL"
}
<button onClick="changeLocation()">JP</button>
★パーマリンク設定によっては404エラー
→ FV Top Level Categories 追加
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 12,
'category_name' => "tokyo,tokyo23,kyushu,kanto,kansai,hokkaido",
'orderby' => 'modified',
'paged' => $paged,
);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) :
?>
<ul class="clearfix hM01">
<?php while ($the_query->have_posts()) : $the_query->the_post();?>
<?php
$category = get_the_category();
$cat_name = $category[0]->cat_name;
$cat_slug = $category[0]->category_nicename;
$field = get_field_object('pref-name');
$value = get_field('pref-name');
$label = $field['choices'][ $value ];
?>
<li>
<a href="<?php echo esc_url( home_url( '/' ) ); ?><?php echo $cat_slug; ?>#<?php the_ID(); ?>"><time><?php the_modified_date('Y年m月d日'); ?></time>
<?php if(get_field('pref-name')): ?>
<?php echo $label; ?>
<?php else: ?>
<?php echo $cat_name; ?>
<?php endif; ?>
<?php the_title(); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
<div class="detailLink"><a href="<?php echo esc_url( home_url( '/' ) ); ?>result">一覧</a></div>
<?php else : ?>
<div id="worksNon">
現在、発行実績は御座いません。
</div>
<?php endif; wp_reset_query(); ?>
function my_sort_order_by_modifired ( $query ) {
if ( $query->is_main_query() ) {
$query->set( 'orderby', 'modified' );
}
}
add_action( 'pre_get_posts', 'my_sort_order_by_modifired' );
条件分岐
// ホームだけの場合
if ( $query->is_home() )
// ホームまたはカテゴリーページの場合
if ( $query->is_home() || $query->is_category() )
if ( $query->is_front_page() && $query->is_category() )
ファイル名のテキストリンクを表示
<?php
$file = get_field('file');
if($file){
echo '<a href="'.$file['url'].'">'.$file['filename'].'</a>';
}
?>
出力一覧
<?php
$file = get_field('file');
if($file){
echo $file['id']; // ファイルの ID を表示
echo $file['title']; // ファイルのタイトルを表示
echo $file['filename']; // 拡張子を含むファイル名を表示
echo $file['url']; // ファイルの URL を表示
echo $file['alt']; // ファイルの alt を表示
echo $file['author']; // ファイルの管理者IDを表示
echo $file['description']; // ファイルのディスクリプションを表示
echo $file['caption']; // ファイルのキャプションを表示
echo $file['name']; // 拡張子を除いたファイル名を表示
echo $file['date']; // ファイルの登録日を表示 20XX-08-08 08:08:08
echo $file['modified']; // ファイルの最終更新日を表示 20XX-08-08 08:08:08
echo $file['mime_type']; // MIME タイプ、PDFであれば application/pdf を返します
echo $file['type']; // ファイルタイプ、PDFであれば application を返します
echo $file['icon']; // WordPress 共通のファイルアイコンのパス
}
?>
print-color-adjust: exact;
-moz-print-color-adjust: exact;
-webkit-print-color-adjust: exact;
class で設定
mw_wp_form:全画面共通
mw_wp_form_input:入力画面
mw_wp_form_confirm:確認画面
mw_wp_form_complete:送信完了画面
wp-config.php
update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );
functions.php
update_option('siteurl','http://example.com');
update_option('home','http://example.com');