How to add View non AMP and other things in Header

I am making this tutorial to show how to add View non-AMP and other things in Header.

So, let’s dig into it.

First, create a Custom plugin, you can just copy this code as well.

After creating a custom plugin, add the code in the header using the hook.

You can copy this code as well(only if you are using Design 2)

add_action('ampforwp_header_top_design2','view_non_amp_header');

function view_non_amp_header(){
	ampforwp_view_nonamp();
 }

Note: Don’t forget to change the hook name if you are using a different design. You can check the hooks name here: Hooks in Header

You can add other things like text, images etc., as well.

Isn’t it easy? you can do it while having your morning coffee as well.

If you have any queries regarding this feel free to ask.

And don’t forget to leave the feedback if it helps you. 🙂

https://wordpress.org/support/plugin/accelerated-mobile-pages/reviews/

Share
Published by
Marqas

How to add Adobe Analytics in AMP

Follow these steps to add Adobe Analytics in AMP Step 1: Go to WordPress Admin Area -> AMP…

4 months ago

What is the CWV plugin all about

Core Web Vitals are the subset of Web Vitals that apply to all web pages,…

6 months ago

How to fix “Alternate page with proper canonical tag” Page Index issue in Google Search Console

The following reasons can be shown for non-indexing. Server error (5xx) Your server returned a 500-level…

7 months ago

Google Analytics ( GA4 ) integration in AMPforWP

We have added the Google Analytics 4 ( GA 4 ) integration in AMPforWP v1.0.80.…

1 year ago

How to add Marfell Analytics in AMP

In this article, I will show you how to add Dotmetrics Analytics to your AMP…

1 year ago

How to modify the H1-H6 size for mobile devices

In this option, we will show you how to modify the H1-H6 size for mobile…

1 year ago