D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
homehopshortterm
/
public_html
/
wp-content
/
themes
/
pixwell
/
backend
/
panels
/
Filename :
amp.php
back
Copy
<?php /** Don't load directly */ defined( 'ABSPATH' ) || exit; /** amp panel */ if ( ! function_exists( 'pixwell_register_options_amp' ) ) { function pixwell_register_options_amp() { if ( function_exists( 'amp_init' ) ) { return [ 'id' => 'pixwell_config_section_amp', 'title' => esc_html__( 'AMP', 'pixwell' ), 'desc' => esc_html__( 'Customize your site in AMP mode.', 'pixwell' ), 'icon' => 'el el-road', 'fields' => [ [ 'id' => 'info_amp_footer', 'type' => 'info', 'style' => 'info', 'desc' => esc_html__( 'You can adjust additional settings, including background, colors, and copyright information, in "Theme Options > Footer".', 'pixwell' ), ], [ 'id' => 'section_start_amp_footer', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Footer', 'pixwell' ), 'indent' => true, ], [ 'id' => 'amp_footer_logo', 'type' => 'media', 'url' => true, 'preview' => true, 'title' => esc_html__( 'Footer Logo', 'pixwell' ), 'subtitle' => esc_html__( 'Upload AMP footer logo. This setting will override the default footer logo in Logo Settings > Footer Logo.', 'pixwell' ), 'description' => esc_html__( 'Recommended size of the image for logo, 2x height for retina display.', 'pixwell' ), ], [ 'id' => 'amp_footer_menu', 'type' => 'select', 'data' => 'menu', 'title' => esc_html__( 'AMP Footer Menu', 'pixwell' ), 'subtitle' => esc_html__( 'Aside a menu for the AMP site footer.', 'pixwell' ), ], [ 'id' => 'amp_back_top', 'type' => 'switch', 'title' => esc_html__( 'Back to Top', 'pixwell' ), 'subtitle' => esc_html__( 'Enable or disable the back to top button.', 'pixwell' ), 'default' => false, ], [ 'id' => 'section_end_amp_footer', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false, ], [ 'id' => 'section_start_amp_single', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Single Post', 'pixwell' ), 'indent' => true, ], [ 'id' => 'amp_disable_author', 'type' => 'switch', 'title' => esc_html__( 'Author Card', 'pixwell' ), 'off' => esc_html__( 'Default from Single Settings', 'pixwell' ), 'on' => esc_html__( 'Disable on AMP', 'pixwell' ), 'subtitle' => esc_html__( 'Disable the Author Card on the AMP site.', 'pixwell' ), 'default' => false, ], [ 'id' => 'amp_disable_single_pagination', 'type' => 'switch', 'title' => esc_html__( 'Next/Prev Articles', 'pixwell' ), 'off' => esc_html__( 'Default from Single Settings', 'pixwell' ), 'on' => esc_html__( 'Disable on AMP', 'pixwell' ), 'subtitle' => esc_html__( 'Disable the Next/Prev Articles section on the AMP site.', 'pixwell' ), 'default' => false, ], [ 'id' => 'amp_disable_comment', 'type' => 'switch', 'title' => esc_html__( 'Comment Box', 'pixwell' ), 'off' => esc_html__( 'Default', 'pixwell' ), 'on' => esc_html__( 'Disable on AMP', 'pixwell' ), 'subtitle' => esc_html__( 'Disable comment form on AMP site.', 'pixwell' ), 'default' => false, ], [ 'id' => 'amp_disable_related', 'type' => 'switch', 'title' => esc_html__( 'Related Section', 'pixwell' ), 'off' => esc_html__( 'Default from Single Settings', 'pixwell' ), 'on' => esc_html__( 'Disable on AMP', 'pixwell' ), 'subtitle' => esc_html__( 'Disable the related section on the AMP site.', 'pixwell' ), 'default' => false, ], [ 'id' => 'section_end_amp_single', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false, ], [ 'id' => 'section_start_amp_composer', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Ruby Composer', 'pixwell' ), 'indent' => true, ], [ 'id' => 'amp_featured_section', 'type' => 'switch', 'title' => esc_html__( 'Featured Section on HomePage', 'pixwell' ), 'subtitle' => esc_html__( 'Enable or disable the featured section in the page build with Ruby Composer on the AMP site.', 'pixwell' ), 'default' => true, ], [ 'id' => 'amp_home_ppp', 'type' => 'text', 'class' => 'small-text', 'validate' => 'numeric', 'title' => esc_html__( 'Posts per Page', 'pixwell' ), 'subtitle' => esc_html__( 'Select total posts per page for the Ruby Composer on the AMP site. Leave blank if you would like set as the default.', 'pixwell' ), 'default' => '', ], [ 'id' => 'section_end_amp_composer', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false, ], [ 'id' => 'section_start_amp_header_advert', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Header Ad', 'pixwell' ), 'indent' => true, ], [ 'id' => 'amp_header_ad_type', 'type' => 'select', 'title' => esc_html__( 'Header - Ad Type', 'pixwell' ), 'subtitle' => esc_html__( 'Select your ad type to display at the header.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Adsense -', 'pixwell' ), '2' => esc_html__( 'AMP Custom Script Ad', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_header_adsense_client', 'type' => 'text', 'required' => [ 'amp_header_ad_type', '=', '1' ], 'title' => esc_html__( 'Header - Data Ad Client', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-client number ID (without ca-pub-).', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_header_adsense_slot', 'type' => 'text', 'required' => [ 'amp_header_ad_type', '=', '1' ], 'title' => esc_html__( 'Header - Data Ad Slot', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-slot number ID.', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_header_adsense_size', 'type' => 'select', 'required' => [ 'amp_header_ad_type', '=', '1' ], 'title' => esc_html__( 'Header - Adsense Size', 'pixwell' ), 'subtitle' => esc_html__( 'Select a size for this ad.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Responsive -', 'pixwell' ), '2' => esc_html__( 'Fixed Height (90px)', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_header_ad_code', 'type' => 'textarea', 'required' => [ 'amp_header_ad_type', '=', '2' ], 'title' => esc_html__( 'Header - AMP Custom Ad Script', 'pixwell' ), 'subtitle' => esc_html__( 'Input your AMP custom ad script.', 'pixwell' ), 'rows' => 2, 'default' => '', ], [ 'id' => 'section_end_amp_header_advert', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false, ], /** footer advert */ [ 'id' => 'section_start_amp_footer_advert', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Footer Ad', 'pixwell' ), 'indent' => true, ], [ 'id' => 'amp_footer_ad_type', 'type' => 'select', 'title' => esc_html__( 'Footer - Ad Type', 'pixwell' ), 'subtitle' => esc_html__( 'Select your ad type to display at the footer.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Adsense -', 'pixwell' ), '2' => esc_html__( 'AMP Custom Script Ad', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_footer_adsense_client', 'type' => 'text', 'required' => [ 'amp_footer_ad_type', '=', '1' ], 'title' => esc_html__( 'Footer - Data Ad Client', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-client number ID (without ca-pub-).', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_footer_adsense_slot', 'type' => 'text', 'required' => [ 'amp_footer_ad_type', '=', '1' ], 'title' => esc_html__( 'Footer - Data Ad Slot', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-slot number ID.', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_footer_adsense_size', 'type' => 'select', 'required' => [ 'amp_footer_ad_type', '=', '1' ], 'title' => esc_html__( 'Footer - Adsense Size', 'pixwell' ), 'subtitle' => esc_html__( 'Select a size for this ad.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Responsive -', 'pixwell' ), '2' => esc_html__( 'Fixed Height (90px)', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_footer_ad_code', 'type' => 'textarea', 'required' => [ 'amp_footer_ad_type', '=', '2' ], 'title' => esc_html__( 'Footer - AMP Custom Ad Script', 'pixwell' ), 'subtitle' => esc_html__( 'Input your AMP custom ad script.', 'pixwell' ), 'rows' => 2, 'default' => '', ], [ 'id' => 'section_end_amp_footer_advert', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false, ], [ 'id' => 'section_start_amp_top_single_advert', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Single Ad - Top of Content', 'pixwell' ), 'indent' => true, ], [ 'id' => 'amp_top_single_ad_type', 'type' => 'select', 'title' => esc_html__( 'Top - Ad Type', 'pixwell' ), 'subtitle' => esc_html__( 'Select your ad type to display at the top single content.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Adsense -', 'pixwell' ), '2' => esc_html__( 'AMP Custom Script Ad', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_top_single_adsense_client', 'type' => 'text', 'required' => [ 'amp_top_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Top - Data Ad Client', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-client number ID (without ca-pub-).', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_top_single_adsense_slot', 'type' => 'text', 'required' => [ 'amp_top_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Top - Data Ad Slot', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-slot number ID.', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_top_single_adsense_size', 'type' => 'select', 'required' => [ 'amp_top_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Top - Adsense Size', 'pixwell' ), 'subtitle' => esc_html__( 'Select a size for this ad.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Responsive -', 'pixwell' ), '2' => esc_html__( 'Fixed Height (90px)', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_top_single_ad_code', 'type' => 'textarea', 'required' => [ 'amp_top_single_ad_type', '=', '2' ], 'title' => esc_html__( 'Top - AMP Custom Ad Script', 'pixwell' ), 'subtitle' => esc_html__( 'Input your AMP custom ad script.', 'pixwell' ), 'rows' => 2, 'default' => '', ], [ 'id' => 'section_end_amp_top_single_advert', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false, ], [ 'id' => 'section_start_amp_bottom_single_advert', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Single Ad - Bottom of Content', 'pixwell' ), 'indent' => true, ], [ 'id' => 'amp_bottom_single_ad_type', 'type' => 'select', 'title' => esc_html__( 'Bottom - Ad Type', 'pixwell' ), 'subtitle' => esc_html__( 'Select your ad type to display at the bottom single content.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Adsense -', 'pixwell' ), '2' => esc_html__( 'AMP Custom Script Ad', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_bottom_single_adsense_client', 'type' => 'text', 'required' => [ 'amp_bottom_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Bottom - Data Ad Client', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-client number ID (without ca-pub-).', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_bottom_single_adsense_slot', 'type' => 'text', 'required' => [ 'amp_bottom_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Bottom - Data Ad Slot', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-slot number ID.', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_bottom_single_adsense_size', 'type' => 'select', 'required' => [ 'amp_bottom_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Bottom - Adsense Size', 'pixwell' ), 'subtitle' => esc_html__( 'Select a size for this ad.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Responsive -', 'pixwell' ), '2' => esc_html__( 'Fixed Height (90px)', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_bottom_single_ad_code', 'type' => 'textarea', 'required' => [ 'amp_bottom_single_ad_type', '=', '2' ], 'title' => esc_html__( 'Bottom - AMP Custom Ad Script', 'pixwell' ), 'subtitle' => esc_html__( 'Input your AMP custom ad script.', 'pixwell' ), 'rows' => 2, 'default' => '', ], [ 'id' => 'section_end_amp_bottom_single_advert', 'type' => 'section', 'class' => 'ruby-section-end', 'indent' => false, ], [ 'id' => 'section_start_amp_inline_single_advert', 'type' => 'section', 'class' => 'ruby-section-start', 'title' => esc_html__( 'Single Ad - Inline Content', 'pixwell' ), 'indent' => true, ], [ 'id' => 'amp_inline_single_ad_type', 'type' => 'select', 'title' => esc_html__( 'Inline - Ad Type', 'pixwell' ), 'subtitle' => esc_html__( 'Select your ad type to display at the bottom single content.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Adsense -', 'pixwell' ), '2' => esc_html__( 'AMP Custom Script Ad', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_inline_single_adsense_client', 'type' => 'text', 'required' => [ 'amp_inline_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Inline - Data Ad Client', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-client number ID (without ca-pub-).', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_inline_single_adsense_slot', 'type' => 'text', 'required' => [ 'amp_inline_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Inline - Data Ad Slot', 'pixwell' ), 'subtitle' => esc_html__( 'Input the data-ad-slot number ID.', 'pixwell' ), 'default' => '', ], [ 'id' => 'amp_inline_single_adsense_size', 'type' => 'select', 'required' => [ 'amp_inline_single_ad_type', '=', '1' ], 'title' => esc_html__( 'Inline - Adsense Size', 'pixwell' ), 'subtitle' => esc_html__( 'Select a size for this ad.', 'pixwell' ), 'options' => [ '1' => esc_html__( '- Responsive -', 'pixwell' ), '2' => esc_html__( 'Fixed Height (90px)', 'pixwell' ), ], 'default' => '1', ], [ 'id' => 'amp_inline_single_ad_code', 'type' => 'textarea', 'required' => [ 'amp_inline_single_ad_type', '=', '2' ], 'title' => esc_html__( 'Inline - AMP Custom Ad Script', 'pixwell' ), 'subtitle' => esc_html__( 'Input your AMP custom ad script.', 'pixwell' ), 'rows' => 2, 'default' => '', ], [ 'id' => 'amp_inline_single_ad_pos', 'type' => 'text', 'title' => esc_html__( 'Inline - After Paragraph', 'pixwell' ), 'subtitle' => esc_html__( 'display this ad after x paragraph. Default is 2', 'pixwell' ), 'default' => '2', ], [ 'id' => 'section_end_amp_inline_single_advert', 'type' => 'section', 'class' => 'ruby-section-end no-border', 'indent' => false, ], ], ]; } else { return [ 'id' => 'pixwell_config_section_amp', 'title' => esc_html__( 'AMP', 'pixwell' ), 'desc' => esc_html__( 'Customize your site in AMP mode.', 'pixwell' ), 'icon' => 'el el-road', 'fields' => [ [ 'id' => 'amp_info_warning', 'type' => 'info', 'style' => 'warning', 'desc' => html_entity_decode( esc_html__( 'The AMP (Accelerated Mobile Pages) Plugin is missing! Please install and activate the <a target="_blank" href="https://wordpress.org/plugins/amp">Automattic AMP</a> plugin to enable the settings.', 'pixwell' ) ), ], ], ]; } } }