Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create an additional php file for attachment (Media) pages ?? #3324

Closed
Stafik120 opened this issue Sep 23, 2019 · 1 comment
Closed
Labels
Support Help with setup, implementation, or "How do I?" questions.

Comments

@Stafik120
Copy link

Stafik120 commented Sep 23, 2019

Now working only Single.php

Full path - amp/templates/single.php

Now working:

site.com/post.html/amp - ( working from amp/templates/single.php)

site.com/post.html/post-media?amp - ( working from amp/templates/single.php) too),
need additional attachment php file, for example - amp/templates/attachment.php - How to create it?

HELP pls

@westonruter westonruter added the Support Help with setup, implementation, or "How do I?" questions. label Sep 23, 2019
@westonruter
Copy link
Member

I assume you are using Reader mode. You must not edit the files in the amp/templates directory, as the changes will be lost when the plugin updates. You must instead create an amp directory in your custom theme and then put the customized single.php there instead.

Also, the attachment template is not supported in Reader mode, as can be seen here:

$template = is_page() || $wp_query->is_posts_page ? 'page' : 'single';

Adding support for attachment templates in Reader mode would be something to request as part of #2044.

Attachment templates are supported in Transitional and Standard modes, but your theme may not be compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

2 participants