This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($){ | |
| /* | |
| * jQuery page scroll | |
| */ | |
| var topBtn = $('#page-top'); // 先頭に戻るボタンの入るDOM | |
| var topHash = '#_top'; // 先頭に戻るボタンのhrefの中身 | |
| var viewPos = 100; // 先頭に戻るボタンが表示され始める位置 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($) { | |
| $(window).on('load resize', function(){ | |
| // masthead scroll | |
| var header = $('#header-nav'); // fixed DOM | |
| var addclass = 'scrolled'; // add css class | |
| var offset = header.offset(); | |
| var scrollY = offset.top; // scroll | |
| $(window).scroll(function() { | |
| if ($(window).scrollTop() > scrollY) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $args = array( | |
| 'posts_per_page' => 5, | |
| 'offset' => 0, | |
| 'category' => '', | |
| 'orderby' => 'post_date', | |
| 'order' => 'DESC', | |
| 'include' => '', | |
| 'exclude' => '', | |
| 'meta_key' => '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: My Jetpack Publicize Message | |
| Plugin URI: | |
| Description: | |
| Version: 0.1.0 | |
| Author: Your Name | |
| Author URI: | |
| License: GPL2 | |
| License URI: https://www.gnu.org/licenses/gpl-2.0.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function my_must_login_pages() { | |
| if ( is_feed() ) // フィードの時は除外 | |
| return; | |
| $loginflg = false; // 条件が増えてもいいようにフラグを作っておく。 デフォルトはfalse | |
| if ( has_term( 'private', 'category' ) ) { | |
| $loginflg = true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function jptweak_remove_share() { | |
| remove_filter( 'the_content', 'sharing_display',19 ); | |
| remove_filter( 'the_excerpt', 'sharing_display',19 ); | |
| if ( class_exists( 'Jetpack_Likes' ) ) { | |
| remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); | |
| } | |
| } | |
| add_action( 'loop_start', 'jptweak_remove_share' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'admin_head-post-new.php', 'mytheme_post_edit_required' ); // 新規投稿画面でフック | |
| add_action( 'admin_head-post.php', 'mytheme_post_edit_required' ); // 投稿編集画面でフック | |
| function mytheme_post_edit_required() { | |
| ?> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function($){ | |
| if( 'post' == $('#post_type').val() || 'page' == $('#post_type').val() ){ // post_type 判定。例は投稿と固定ページ。カスタム投稿タイプは適宜追加 | |
| $("#post").submit(function(e){ // 更新あるいは下書き保存を押したとき | |
| if('' == $('#title').val()) { // タイトル欄の場合 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wp_enqueue_script( 'yubinbango', 'https://yubinbango.github.io/yubinbango/yubinbango.js', array(), null, true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function my_open_graph_image_default( $image ) { | |
| $image = get_stylesheet_directory_uri() . '/images/my_open_graph_image_default.png'; | |
| return $image; | |
| } | |
| add_filter( 'jetpack_open_graph_image_default', 'my_open_graph_image_default' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Register Custom Post Type | |
| function my_custom_post_type() { | |
| $labels = array( | |
| 'name' => _x( 'Products', 'Post Type General Name', 'text_domain' ), | |
| ); | |
| $args = array( | |
| 'label' => __( 'product', 'text_domain' ), | |
| 'supports' => array( 'title', 'editor', 'publicize', 'wpcom-markdown' ), | |
| ); |