Skip to content

Instantly share code, notes, and snippets.

View norilog4's full-sized avatar
😎
ブログ書いてます

noriposo norilog4

😎
ブログ書いてます
View GitHub Profile
@norilog4
norilog4 / functions.php
Last active August 31, 2019 15:41
WordPress ダッシュボード表示ウィジェットコントロール
function remove_dashboard_widget() {
remove_action( 'welcome_panel','wp_welcome_panel' ); // ようこそ
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); // 概要
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' ); // アクティビティ
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // クイックドラフト
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // WordPress イベントとニュース
}
add_action('wp_dashboard_setup', 'remove_dashboard_widget' );
@norilog4
norilog4 / share-buttons.php
Last active November 1, 2019 13:38
\SHARE/ と書かれた記事の下にある部分を別のテキストに変更
<?php
/**
* このファイルではシェアボタンを出力するための関数をまとめています
*/
// シェア用のページタイトルを取得
if (!function_exists('sng_get_encoded_title_for_share')) {
function sng_get_encoded_title_for_share() {
// トップ以外はタイトルに「|サイト名」を含める
$title = sng_get_page_title();
if(!is_front_page() && !is_home()) {
@norilog4
norilog4 / sample-style.css
Created October 31, 2019 17:28
\SHARE/ 文字の色を変更
.sns-btn__title {
display: inline-block;
position: relative;
padding: 0 25px;
color: #44B3D8; /*色を変更*/
font-size: 18px; /*適宜サイズを変更*/
font-weight: bold;
line-height: 1;
letter-spacing: 1px;
}
@norilog4
norilog4 / sample-style.css
Created October 31, 2019 17:28
\SHARE/ 文字の色を変更
.sns-btn__title {
display: inline-block;
position: relative;
padding: 0 25px;
color: #44B3D8; /*色を変更*/
font-size: 18px; /*適宜サイズを変更*/
font-weight: bold;
line-height: 1;
letter-spacing: 1px;
}
@norilog4
norilog4 / sample-style2.css
Created October 31, 2019 17:33
\SHARE/ の両端の\/の色を変更
.sns-btn__title:before,
.sns-btn__title:after {
display: inline-block;
position: absolute;
top: 50%;
width: 20px;
height: 3px;
border-radius: 3px;
background-color: #44B3D8; /*この部分を変更*/
content: "";
@norilog4
norilog4 / comments.php
Created November 1, 2019 16:20
WordPressの縦に長いコメント欄をクリックで開閉式にするカスタマイズ方法
<div id="comments-toggle">コメントを閉じる</div>
<script>
$(function() {
$("#comments-toggle").click(function() {
if ($("#comments").css("display") == "none") {
$("#comments").slideToggle();
$("#comments-toggle").text("コメント欄を閉じる");
} else {
$("#comments").slideToggle("fast");
$("#comments-toggle").html("この記事にコメントする(<i class=\"far fa-comment-dots\"></i>&nbsp;<?php echo get_comments_number(); ?>)");
@norilog4
norilog4 / style.css
Last active November 1, 2019 16:30
style.cssへ追記するコード
/* コメント欄の開閉ボタンのデザイン修正 */
#comments-toggle {
display: block;
margin: 25px 15% 25px 15%;
padding: 3px 0px;
background-color: #44B3D8; /* ここを変更して好きな色に変更 */
border-radius: 3px;
color: #fff;
font-size: 1em;
font-weight: bold;
@norilog4
norilog4 / page.php
Created November 2, 2019 23:00
固定ページのコメントを外す前のコード
<?php get_header(); ?>
<div id="content"<?php column_class();?>>
<div id="inner-content" class="wrap cf">
<main id="main" class="m-all t-2of3 d-5of7 cf">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="entry" <?php post_class('cf'); ?>>
<header class="article-header entry-header page-header">
<?php if(is_front_page()) : // ホーム固定の場合 ?>
<h2 class="page-title"><?php the_title(); // タイトル ?></h2>
<?php else : // 通常の場合 ?>
@norilog4
norilog4 / page.php
Created November 2, 2019 23:09
固定ページのコメント部分コードを削除した後
<?php get_header(); ?>
<div id="content"<?php column_class();?>>
<div id="inner-content" class="wrap cf">
<main id="main" class="m-all t-2of3 d-5of7 cf">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article id="entry" <?php post_class('cf'); ?>>
<header class="article-header entry-header page-header">
<?php if(is_front_page()) : // ホーム固定の場合 ?>
<h2 class="page-title"><?php the_title(); // タイトル ?></h2>
<?php else : // 通常の場合 ?>
@norilog4
norilog4 / entry-footer.php
Created November 4, 2019 09:50
カテゴリの日本語化とアイコン追加
<footer class="article-footer">
<aside>
<div class="footer-contents">
<?php insert_social_buttons(); // シェアボタン ?>
<?php insert_like_box(); // フォローボックス ?>
<div class="footer-meta dfont">
<?php if(get_the_category_list()) : // カテゴリー一覧を出力 ?>
<p class="footer-meta_title"><i class="fas fa-list-ul"></i> カテゴリー :</p>
<?php echo get_the_category_list(); ?>
<?php endif; ?>