- Priority: 0
- Status: Closed
- Theme: Alysum
-
Assigned To:
Fred
- Private: No
- Open Date: 10.05.21, 12:29
- Opened by: Rosita Paparelli
- Closed by: Fred
- Closed on: 28.05.21, 11:26
- Reason: Closed
- Comment: Glad to help!
Ticket #21478 - Exclude some pages from amp version
Hi,
I need to exclude some pages from AMP version in alysum theme.
In other words when users navigate the site from mobile device I need to show all pages in AMP version EXCEPT some specific page IDS.
Can you indicate a method to obtain this result?
Thanks.
Comments
Hi, Rosita.
Open the file /modules/pkamp/pkamp.php
Find the line
add following code before
Hi, thanks for the reply.
I have forgotten to specify that those pages are all CMS pages.
So what do I have to insert at the place of “YOUR_PAGE_NAME”? The permalink of the page ($cms.link_rewrite)? The meta title? The content of the variable $page.page_name (which is “cms”…).
Thank you.
try this
Sorry but it doesn’t work… I need to exclude only some pages, not every cms page…
Sorry but it doesn’t work… I need to exclude only some pages, not every cms page…
It requires deeper code customisations. We have too much tickets and not available for custom works
Hi,
is there an additional price to pay for this kind of customization?
I would do that for free, but this week we have too much tickets
Maybe on weekend
Ok, thanks, I look forward for a reply.
I have already created a custom child theme with the module/pk_amp directory inside.
Best regards.
try this
where “1” is an ID of your page
Sorry but even this way it doesn’t work, you can check yourself visiting this page: https://www.lapiantadelte.it/shop/mobile/page/10-contattaci
Please update credentials in your profile https://support.promokit.eu/index.php?do=myprofile to access to your server through FTP
Done: I have updated the credentials.
Thank you.
Done: I have updated the credentials.
Thank you.
Something wrong here.
I edit the file /web/test_shop/modules/pk_amp/pk_amp.php but nothing is changed in the website
Hi: the file to edit is in the web/shop directory, as mentioned in our FTP credentials section, NOT in web/TEST_shop…
Now everything works fine.
If you will open the page https://www.lapiantadelte.it/shop/content/10-contattaci on mobile, you will not be redirected to AMP
Yes, now the page has no redirect. As I said above I need to exclude more than one page.
Did you modified the line you mentioned before inside pk_amp.php? Because it seems to me that the modification you made is elsewhere.
Can you tell me where to add some other pages ids?
Thank you!
The file I edit is
find the line
Add more IDs like this
It’s very strange but it works only for page id 10, even if I added other pages… I believe it’s a matter of caching… I have tried to clear the cache but with no result, I have also tried clearing the file var/cache/prod/class_index.php but, again, with no result.
I just added page id 8 for example, and it works correctly, there is no redirect
https://www.lapiantadelte.it/shop/content/8-privacy-policy
Hi,
goodmorning can you please help me resolve the problem?
My client is very upset: he really needs to exclude also other pages from AMP version, and I can’t make the code you suggested work properly!
Can you please check yourself?
Thank you so much!
I just added page id 8 for example, and it works correctly, there is no redirect
https://www.lapiantadelte.it/shop/content/8-privacy-policy
Ok, now I understood: you have modified the core, I created a child theme… inside the child the modification doesn’t work… But this is another problem.
Thank you for the support so far.
Best regards.