Skip to content

Instantly share code, notes, and snippets.

@akahigeg
akahigeg / post_guide.css
Last active June 3, 2018 05:30
CSS for WordPress post guide.
ul.post-guide-panel {
position: fixed;
table-layout: fixed;
top: 30;
width: 100%;
z-index: 88888;
}
ul.post-guide-panel li {
position: relative;
@akahigeg
akahigeg / post_guide.js
Last active June 3, 2018 05:22
JavaScript file for WordPress post guide.
jQuery(document).ready(function () {
// 投稿の新規追加もしくは編集画面以外では表示しない
if (location.pathname != '/wp-admin/post-new.php' && location.pathname != '/wp-admin/post.php') {
return;
}
// 投稿ガイドの表示
initPostGuide();
});
@akahigeg
akahigeg / functions.php
Last active June 3, 2018 05:00
functions.php for WordPress post guide.
<?php
// 管理画面にCSSとJSの読み込みを追加
function enqueue_post_guide_files() {
wp_enqueue_style('post-guide-style' , get_stylesheet_directory_uri() . '/css/post_guide.css');
wp_enqueue_script('post-guide-js' , get_stylesheet_directory_uri() . '/js/post_guide.js');
}
add_action('admin_enqueue_scripts', 'enqueue_post_guide_files');
// 指定されたpost_idの投稿の投稿タイプを返す
function ajax_post_type_by_post_id() {
@akahigeg
akahigeg / post_title.html(in post_guide directory)
Created June 3, 2018 05:24
Help file for WordPress post guide.
<h3>タイトル <span style="color: red; font-size: 9pt;">必須項目</span></h3>
<p>記事のタイトル。</p>
<p>全角28文字以内になることを想定にサイトのデザインは作成されている。</p>
<h4>表示される場所</h4>
<h5>トップページ</h5>
画像入れたりとか
<h5>記事の一覧</h5>
ごにょごにょ
<h5>カテゴリーの一覧</h5>