Tatiane Pires
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact Form 7] Support for AMP Pages on Contact Form 7This code may help you while we wait for an update on Contact Form 7 to support AMP pages.
I’m using Automattic’s AMP plugin, https://www.ads-software.com/plugins/amp/. It provides the function is_amp_endpoint().
This function will let you add contact forms to your posts (it adds to every post though), except when they’re being displayed as AMP pages.
Add this function to the file functions.php of your theme.
<?php function tps_add_mailchimp_wpcf7($content){ global $post; if( $post->post_type == 'post' && $post->post_status == 'publish' ) { $form_id = type_here_the_post_ID_of_your_contact_form; $shortcode = sprintf('[contact-form-7 id="%d"]', $form_id); if( function_exists('is_amp_endpoint') && is_amp_endpoint() ) { return $content; } elseif ( get_post_type($form_id) == 'wpcf7_contact_form' && get_post_status($form_id) == 'publish' ) { $content .= do_shortcode($shortcode); return $content; } } else { return $content; } } add_filter( "the_content", "tps_add_mailchimp_wpcf7" );
Forum: Plugins
In reply to: [AMP] Hook to customize website colors on CSSNever mind. I found what I need. I think this is going to do the trick:
add_action( 'amp_post_template_css', 'xyz_amp_additional_css_styles' );
This is the page I was looking for! Thanks, Jeremy!
I tried Lockdown WP Admin, and the same “Forbidden” thing happened when I tried to setup a different URL for the login page.
So I switched back to Cerber, because I like the feature to include reCaptcha in the login form.
I’ll do the deactivate all plugins test on localhost to see if I can find the cause of the issue.
It didn’t work. I added the page slug to “Never cache the following pages” with both slashes, only first, only last, and no slashes. Always saving changes with “Save Settings & Purge Caches”. Nothing changed: the “Forbidden” message was still there. Is it possible that the browser cached the page with the “Forbidden” message?
There is one setting that is not default though, and I previously forget about it. Does “Cerber Lab protocol” set to HTTPS have anything to do with it? My first thought is that it doesn’t, but I can’t tell for sure.
- This reply was modified 8 years, 1 month ago by Tatiane Pires.
Gioni,
I use W3 Total Cache, no firewall so far.
I tried clearing all caches after setup the alternate URL, but the “Forbidden” message continues.