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 create an AWeber form in AMP

If you want to add an AWeber form in AMP then first you need to…

3 years ago

How to setup webpushr notification in AMP

Webpushr is the fastest growing web push notifications platform that marketers love & developers rely…

3 years ago

How to add Adobe Analytics in AMP

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

3 years ago

What is the CWV plugin all about

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

4 years 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…

4 years ago

Google Analytics ( GA4 ) integration in AMPforWP

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

4 years ago