5月 19, 2015 | wordpress
WP Total Hacksはすばらしい神プラグインですが、毎回設定する時間を短縮するために functions.phpに追加 各画像は自分でテーマフォルダの中に配置しアップロードしてください。 <?php //管理画面にcss function wp_custom_admin_css() { echo “\n” . ‘<link href=”‘ .get_bloginfo(‘template_directory’)....2月 7, 2015 | wordpress
// アイキャッチ画像の初期設定、数字の箇所にメディアIDを記入 add_action( ‘save_post’, ‘save_default_thumbnail’ ); function save_default_thumbnail( $post_id ) { $post_thumbnail = get_post_meta( $post_id, $key = ‘_thumbnail_id’, $single = true ); if (...12月 5, 2014 | wordpress
wordpress投稿、固定ページ毎の閲覧パスワード制限 function.phpに以下を記述します。 // 「保護中」を消す—————————————————-// add_filter(‘protected_title_format’, ‘remove_protected’);...3月 25, 2014 | wordpress
functions.phpに追加 /** * ここから追加 *編集者にエクスポート権限を与える */ function add_theme_caps(){ $role = get_role(‘editor’); $role->add_cap(‘export’); } add_action( ‘admin_init’, ‘add_theme_caps’); ...2月 21, 2014 | wordpress
まずはindex.php、category.php、content.phpなどに抜粋のタグが記述されていることが前提になります。 <?php the_excerpt(); ?> デフォルトは110文字 文字数を制限したい時には下記を記述 <?php echo mb_substr(get_the_excerpt(), 0, 30); ?> 日本語や中国語で「続きを読む」「看全部」を追加する。 使用しているテーマの functions.phpに下記コードを追加。 //the_excerptに続きを読むを追加...8月 14, 2013 | 会員サイト
参考サイト tenman.info… functions.phpに追記 /* ユーザー(自分)のコメントだけ、ダッシュボードに表示 */ add_filter(‘pre_get_comments’, ‘my_comments_for_current_author’); /* コメントの編集を許可*/ add_filter( ‘user_has_cap’, ‘my_user_has_cap’, 10, 3 );...4月 26, 2013 | wordpress
ユーザーが複数名いるサイトに使えそう?ギャラリーサイトに functions.phpに追記 //*=============================================* //*指定した著者名の画像一覧 function set_ItemLists_byId( $atts, $content = null) { extract(shortcode_atts(array( ‘num’ => ”, ‘author’ => ” ),...4月 16, 2013 | wordpress
参考サイト 1bit.mobi… 納品の際などにお客様がビジュアルエディタで記事を書いても見た目がどう変わるかわかるようにジュアルエディタにもcssを適用させます。 1.functions.phpに記述 functions.phpに以下を記述します。今まではカッコの中にファイル名を指定していましたが、それも不要なようです。 add_editor_style(); 2.テーマファイルのルートに「editor-style.css」を作成 editor-style.cssという名前でテーマのルートにアップします。...3月 24, 2013 | 会員サイト
functions.phpに追記 function dashboard_widget_function() { echo “お疲れ様です。”; } function add_dashboard_widgets() { wp_add_dashboard_widget(‘dashboard_widget_welcome’, ‘ようこそ’, ‘dashboard_widget_function’); }...3月 22, 2013 | 会員サイト
ダッシュボード右上の表示オプションを非表示にしておくとwordpressに慣れていない方でも混乱しないかもしれません。 「functions.php」に下記タグを入力 <?php function my_admin_head(){ echo ‘<style type=”text/css”>#screen-options-link-wrap{display:none;}</style>’; }...3月 1, 2013 | wordpress
参考サイト www.understandard.net… 納品後お客さんから上のメニュー何?みたいになるので非表示にしておきましょう functions.phpに追記 function my_function_admin_bar($content) { return ( current_user_can(“administrator”) ) ? $content : false; } add_filter( ‘show_admin_bar’ ,...2月 22, 2013 | 会員サイト
参考サイト kachibito.net… functions.phpに追加 テーマファイルの中に/css/foo.cssを追加 <?php function wp_custom_admin_css() { echo “n” . ‘<link href=”‘ .get_bloginfo(‘template_directory’). ‘/css/foo.css’ . ‘”...2月 22, 2013 | 会員サイト
アイキャッチ画面等いう言葉は一般の方にはなじみがないかもしれません。 投稿画面に説明文を追加しておくとしんせつですね。 参考サイト kachibito.net… 参考サイト presentnote.com… function add_featured_image_instruction( $content ) { return $content .=...2月 22, 2013 | 会員サイト
プラグインが増えすぎたので減らすためにもadminmizeやめてfunctions.phpに追記 下記参考サイト ja.forums.wordpress.org… htdsn.com… kachibito.net… WordPressの管理ページをより便利にカスタマイズする方法13 www.webopixel.net… <?php // ダッシュボードウィジェット非表示 function example_remove_dashboard_widgets() {...2月 16, 2013 | 会員サイト
functions.phpに追記 /** * アドミンバーを常に非表示 */ add_filter( ‘show_admin_bar’, ‘__return_false’ ); 参考サイト takahashifumiki.com… /** * アドミンバーを常に表示 * @return boolean */ function _my_show_admin_bar(){ return true; } add_filter(...