Skip to content

Commit

Permalink
[add]Amazonリンクのためのプラグイン調整
Browse files Browse the repository at this point in the history
Amazonのリンク設置のためのプラグイン「AmazonJS」「Rinker」のための設定を追加
  • Loading branch information
ultimate-ez committed Jan 27, 2019
1 parent 637ad3d commit b2efbc3
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 17 deletions.
4 changes: 2 additions & 2 deletions amp/style.php
Expand Up @@ -107,8 +107,8 @@
border-bottom: 1px dashed;
}
#content .post amp-img{
display: block;
width: 100%;
width: auto;
height: auto;
max-width: 100%;
}
#content h2{
Expand Down
1 change: 1 addition & 0 deletions css/plugins/amazonjs_custom_style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions css/plugins/rinker_custom_style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions lib/customizer/se-customizer-general.php
Expand Up @@ -71,20 +71,6 @@ function sentry_customize_register_general( $wp_customize ){
'priority' => 50,
));

// wppのview数の非表示
$wp_customize->add_setting( 'sentry_wpp_is_hidden', array(
'default' => false,
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_checkbox',
));
$wp_customize->add_control( 'sentry_wpp_is_hidden_c', array(
'section' => 'sentry_section',
'settings' => 'sentry_wpp_is_hidden',
'label' => 'Wordpress Popular Postsのview数を表示しない。',
'type' => 'checkbox',
'priority' => 60,
));

// Sentryプロモーション
$wp_customize->add_setting( 'sentry_promotion', array(
'default' => false,
Expand Down
54 changes: 54 additions & 0 deletions lib/customizer/se-customizer-plugins.php
@@ -0,0 +1,54 @@
<?php
function sentry_customize_register_plugins( $wp_customize ){

// プラグインの設定
$wp_customize->add_section( 'sentry_plugins_section', array(
'title' => '[Sentry]プラグイン設定',
'priority' => 50,
));

// wppのview数の非表示
$wp_customize->add_setting( 'sentry_wpp_is_hidden', array(
'default' => false,
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_checkbox',
));
$wp_customize->add_control( 'sentry_wpp_is_hidden_c', array(
'section' => 'sentry_plugins_section',
'settings' => 'sentry_wpp_is_hidden',
'label' => 'Wordpress Popular Postsのview数を表示しない。',
'type' => 'checkbox',
'priority' => 10,
));

// AmazonJS用カスタムCSS
$wp_customize->add_setting( 'sentry_amazonjs_custom_css', array(
'default' => false,
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_checkbox',
));
$wp_customize->add_control( 'sentry_amazonjs_custom_css_c', array(
'section' => 'sentry_plugins_section',
'settings' => 'sentry_amazonjs_custom_css',
'label' => 'AmazonJSのカスタムCSSを適用する。',
'type' => 'checkbox',
'priority' => 21,
));

// Rinker用カスタムCSS
$wp_customize->add_setting( 'sentry_rinker_custom_css', array(
'default' => false,
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_checkbox',
));
$wp_customize->add_control( 'sentry_rinker_custom_css_c', array(
'section' => 'sentry_plugins_section',
'settings' => 'sentry_rinker_custom_css',
'label' => 'RinkerのカスタムCSSを適用する。',
'type' => 'checkbox',
'priority' => 22,
));

}
add_action( 'customize_register', 'sentry_customize_register_plugins' );
?>
2 changes: 2 additions & 0 deletions lib/se-func-customizer.php
Expand Up @@ -10,6 +10,8 @@

require_once ('customizer/se-customizer-sns.php');

require_once ('customizer/se-customizer-plugins.php');

require_once ('customizer/se-customizer-amp.php');

require_once ('customizer/se-customizer-pwa.php');
Expand Down
12 changes: 11 additions & 1 deletion lib/se-func-init.php
Expand Up @@ -57,8 +57,18 @@ function sentry_enqueue_script() {
wp_enqueue_script( 'wp_infinite_scroll' );
}

//slick
// slick
wp_enqueue_script( 'slick', get_template_directory_uri() . '/js/slick.min.js' , array('jquery'), null, true);

/* Custom Style for Plugins */
// AmazonJS
if ( absint( get_theme_mod( 'sentry_amazonjs_custom_css', false ) ) ){
wp_enqueue_style( 'amazonJS_custom', get_template_directory_uri().'/css/plugins/amazonjs_custom_style.css', array('amazonjs'), wp_theme_version(), false );
}
// Rinker
if ( absint( get_theme_mod( 'sentry_rinker_custom_css', false ) ) ){
wp_enqueue_style( 'rinker', get_template_directory_uri().'/css/plugins/rinker_custom_style.css', array(), wp_theme_version(), false );
}
}
}
add_action( 'wp_enqueue_scripts', 'sentry_enqueue_script' );
Expand Down

0 comments on commit b2efbc3

Please sign in to comment.