• Resolved JJ

    (@jimmyj352)


    Hi there – I really like this plugin and it seems to work very well. The one issue I’m having though is with my archives page. The AMP version of the page shows up blank except for a couple of ads I have on all my pages.

    I think the twist is that I do a customs archive page using a page-archive.php file. However, the link is for https://www.routetoretire.com/archives/ for end users. That archives page is blank in WordPress as the page-archive.php does all the heavy lifting to create the page on the fly so I think that’s the problem.

    I’m Ok with this stuff, but not a developer by any means. Google’s now sending me emails “yelling” at me for this issue. Any thoughts on how I can fix it?

    Thanks so much!

    — Jim

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi @jimmyj352

    After checking the URL, it seems like that page is a “Page Template”, right?

    so that content, is it coming from the code?

    Thread Starter JJ

    (@jimmyj352)

    Wow, you’re good! Yes, the template is set to Archives so I assume that means that it just uses all the code in the page-archive.php. Looking at the page-archive.php page in the Editor, it does say Archives Page Template and is listed as the template name in the code of the PHP file.

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi @jimmyj352

    Thanks ?? I solve problems on daily basis ??

    So, Can you modify that page through custom AMP Editor and add the content just for AMP. I suppose that would be the easiest way at the moment.

    Thread Starter JJ

    (@jimmyj352)

    I’m always good with the easy solution, Ahmed! However, since it’s all PHP, can I add that into the Custom AMP Editor?

    — Jim

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi @jimmyj352

    You can’t add the PHP code into customizer, however, you can just copy the output and enter it manually for now I suppose?

    You can override that specific file with php code as well. Or if you are not technical enough, you can use our ACF for AMP extension which allows you to execute php code anywhere as a user.

    Thread Starter JJ

    (@jimmyj352)

    Ok, thanks, Ahmed – I’ll try to figure out how to override the file with PHP code. Hopefully that doesn’t turn out to be to hard to do.

    — Jim

    Thread Starter JJ

    (@jimmyj352)

    I’m not sure if this will work, but I decided to just exclude AMP for that page. Hopefully, Google will be Ok with that.

    — Jim

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi @jimmyj352

    Sure, If that helps you.

    Could you let me know what’s the content that you were trying to exclude?

    Thread Starter JJ

    (@jimmyj352)

    Well, that page is a list of all my posts that is created on the fly through PHP. It would be a real hassle to have to create the content manually each time instead of leveraging PHP to just do the work for me.

    Did you have another thought on this?

    — Jim

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi @jimmyj352

    yes, that’s possible. If you can give me the URL and the actual scenario, then it would be helpful for me to understand the solution for you

    Thread Starter JJ

    (@jimmyj352)

    Hi Ahmed – the URL is https://www.routetoretire.com/archives/

    Without pasting the whole code for the page, the PHP code basically runs things like:

    <?php compact_archive($style=’block’); ?>

    and

    <?php wp_list_categories(‘title_li=’); ?>

    Then it runs some code to get all posts and break them up by month.

    Does that help or do you need more info?

    — Jim

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Yes, that’s definitely possible. you can get some of the code from here: https://www.smashingmagazine.com/2015/04/building-custom-wordpress-archive-page/

    and use at the proper places, it should work perfectly

    Thread Starter JJ

    (@jimmyj352)

    Thanks, Ahmed – I already have the working code going for this. The page works just fine – you can check it out at https://www.routetoretire.com/archives/ to see.

    My problem is that the AMP plugin doesn’t work on that page so I just turned AMP off for it as a workaround.

    — Jim

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘AMP for Archives not working’ is closed to new replies.