アーカイブページ(商品カテゴリ=親の自動チェックが効かない)でブログと同じカテゴリを使うと
表示件数が分岐できない
即席で 小津メインクエリで
//商品カテゴリーは全件表示
if ( $query->is_category(array( 'item','kitchen','stool','others')) && $query->is_main_query() ) {
$query->set('posts_per_page', -1 );
}
商品ページのカーかイブけんすうと
ブログ件数分けたいなら
ぶろぐをすべて親同じにするか
たくそのみーわけたほうがよいな
さらにカスタムフィールドスイートの場合コピーした時おかしくなる
welcartと相性のいいカスタムフィールドはSmart Custom Fieldsみたいだ
ウェルカートユーザーにはすべての権限を持たせたいがワードプレスの中心部を触られたくないばあい
忠告しさらに
ユーザーIDで1以外をカスタムアドミン2を読み込ます。
以下コード
@charset "utf-8";
#profile-page h3,
/*#profile-page table:nth-of-type(1) tr:nth-child(1),*/
#profile-page table:nth-of-type(1) tr:nth-child(2),
#profile-page table:nth-of-type(1) tr:nth-child(3),
#profile-page table:nth-of-type(1) tr:nth-child(4),
#profile-page table:nth-of-type(1) tr:nth-child(5),
#profile-page table:nth-of-type(2) tr:nth-child(2),
#profile-page table:nth-of-type(2) tr:nth-child(3),
#profile-page table:nth-of-type(2) tr:nth-child(4),
#profile-page table:nth-of-type(2) tr:nth-child(5),
#profile-page table:nth-of-type(3) tr:nth-child(2),
#profile-page table:nth-of-type(3) tr:nth-child(3),
#profile-page table:nth-of-type(3) tr:nth-child(4),
#profile-page table:nth-of-type(3) tr:nth-child(5),
#profile-page table:nth-of-type(4) tr:nth-child(1),
#footer-ozh-oam,#footer-upgrade
{
display: none;
}
/*
#menu-dashboard ダッシュボード
#menu-posts 投稿
#menu-media メディア
#menu-links リンク
#menu-pages 固定ページ
#menu-comments コメント
#menu-appearance 外観
#menu-plugins プラグイン
#menu-users ユーザー
#menu-tools ツール
#menu-settings 設定
.wp-menu-separator (区切り線)
*/
#menu-tools,
#menu-plugins,
#menu-settings,
#menu-pages,
#menu-appearance,
#toplevel_page_edit-post_type-cfs,/*スイート*/
#toplevel_page_edit-post_type-acf,/*アドバンス*/
#toplevel_page_cptui_main_menu,/*CPI*/
#toplevel_page_WP-Optimize,/*オプティ*/
#toplevel_page_zencache/*全キャッシュ*/
{
display: none;
}
//このcssでCSS3を使って項目見えなくする
//CSSで管理画面内のサイドメニューを非表示にする 権限指定
function custom_admin_styles(){
$current_user = wp_get_current_user(); //現在のユーザー情報を取得
$user = $current_user->ID;
if($user !== 1){ //doggstar=1 かチェック
echo '<link rel="stylesheet" type="text/css" href="' .get_bloginfo('template_directory'). '/d_con/custom-admin-css2.css" />';
}
}
add_action('admin_print_styles', 'custom_admin_styles', 21);
//これより下はいるのか??
/*
* ユーザーの権限をチェックする
* @param $user ユーザーオブジェクト
* @param $role ユーザー権限の文字列
* (administrator, editor, author, contributor, subscriber)
*/
function check_user_role($user,$role){
foreach($user->roles as $user_role){
if($user_role === $role){
return true;
}
}
return false;
}