This file contains 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
add_action('pre_amp_render_post','ampforwp_remove_default_stylesheet',20); | |
function ampforwp_remove_default_stylesheet(){ | |
remove_action('amp_post_template_css', 'ampforwp_additional_style_input'); | |
} |
This file contains 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_filter('ampforwp_pagebuilder_modules_filter', 'new_pb_module', 99); | |
function new_pb_module( $data ){ | |
$data['custom_text_module'] = custom_module_data(); | |
return $data; | |
} | |
function custom_module_data(){ |
This file contains 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
add_action('amp_post_template_css','ampforwp_add_custom_css_example', 11); | |
function ampforwp_add_custom_css_example() { ?> | |
/* Add your custom css here */ | |
body { | |
background: red; | |
} | |
<?php | |
} |
This file contains 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 | |
// Remove Old File | |
add_action('init','ampforwp_remove_old_header_file',11); | |
function ampforwp_remove_old_header_file(){ | |
remove_filter( 'amp_post_template_file', 'ampforwp_custom_header', 10, 3 ); | |
} | |
// Register New Files | |
add_action('init','ampforwp_custom_header_files_register', 10); | |
function ampforwp_custom_header_files_register(){ | |
add_filter( 'amp_post_template_file', 'ampforwp_custom_header_file', 10, 2 ); |
This file contains 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
this is one |
This file contains 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 | |
if ( ! function_exists( 'ampforwp_create_custom_controls' ) ) { | |
function ampforwp_create_custom_controls() { | |
$controls[] = array( | |
'id' =>'ampforwp-example-select', | |
'type' => 'switch', | |
'title' => __('Example Select', 'redux-framework-demo'), | |
'default' => 0, | |
'true' => 'Enabled', | |
'false' => 'Disabled', |
This file contains 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
// 12. Add Logo URL in the structured metadata | |
add_filter( 'amp_post_template_metadata', 'ampforwp_update_metadata', 10, 2 ); | |
function ampforwp_update_metadata( $metadata, $post ) { | |
global $redux_builder_amp; | |
if (! empty( $redux_builder_amp['opt-media']['url'] ) ) { | |
$structured_data_main_logo = $redux_builder_amp['opt-media']['url']; | |
} | |
if (! empty( $redux_builder_amp['amp-structured-data-logo']['url'] ) ) { |
This file contains 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
// Search Form | |
function ampforwp_get_search_form() { | |
$form = '<form role="search" method="get" id="searchform" class="searchform" target="_top" action="' . trailingslashit( get_bloginfo('url') ) . '?' . AMP_QUERY_VAR . '"> | |
<div> | |
<label class="screen-reader-text" for="s">' . _x( 'AMP SEARCH:', 'label' ) . '</label> | |
<input type="text" value="' . get_search_query() . '" name="s" id="s" /> | |
<input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" /> | |
</div> |
This file contains 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 | |
// Remove all the existing analytics code | |
add_action('init','ampforwp_remove_existing_analytics'); | |
function ampforwp_remove_existing_analytics() { | |
remove_action('amp_post_template_footer','ampforwp_analytics',11); | |
} | |
// Build the markup for Clicky Analytics code | |
function ampforwp_clicky_analytics() { ?> | |
<amp-analytics type="clicky"> |
This file contains 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
add_action('init','ampforwp_remove_existing_analytics'); | |
function ampforwp_remove_existing_analytics() { | |
remove_action('amp_post_template_footer','ampforwp_analytics',11); | |
} |
NewerOlder