I've created a template for attachment pages but while the theme uses it as expected for its "main" url (mainsite/attachmentpage) it does not with the url related to the page/post where the media is inserted (mainsite/page/attachmentpage).
I've created pdf.php (since I'm using it with this files), attachment.php and single-attachment.php files but to no avail.
The problem is that I've created a template for the attachments pages but the theme is not using it for the url that WP assigns to them when the files are associated with a post or page.
I.e. I upload a file through the media library, and its own attachment page has the structure domain/media, this page uses the attachment.php template.
After that, when I add the same file on the content of a post or page, and I set that it is linked to the attachment page, the url of the link is like domain/post/media and this page uses a different template.
I need this pages to use the attachment.php template or make that this link directs to the main url (domain/media instead of domain/post/media). Because manually changing the url each time is not an option.
Please send me your website managment information ( admin url site, username and password ) in order for me to have access to know the exact issue. We will take it a lock on this help you.
What I still don't understand is why the shorter url makes use of the pdf.php template but the other one appears in a totally different manner when attachment.php had the same code.
Hello there,
I've created a template for attachment pages but while the theme uses it as expected for its "main" url (mainsite/attachmentpage) it does not with the url related to the page/post where the media is inserted (mainsite/page/attachmentpage).
I've created pdf.php (since I'm using it with this files), attachment.php and single-attachment.php files but to no avail.
Many thanks.
Hi,
Sorry, I'm not clear about the question.
Do you want create new template page ?
Please checkt this guide to know how to create a custom template page
Best Regards,
PenciDesign
Sorry I didn't myself clear.
The problem is that I've created a template for the attachments pages but the theme is not using it for the url that WP assigns to them when the files are associated with a post or page.
I.e. I upload a file through the media library, and its own attachment page has the structure domain/media, this page uses the attachment.php template.
After that, when I add the same file on the content of a post or page, and I set that it is linked to the attachment page, the url of the link is like domain/post/media and this page uses a different template.
I need this pages to use the attachment.php template or make that this link directs to the main url (domain/media instead of domain/post/media). Because manually changing the url each time is not an option.
Thanks for your help.
Hi,
Please send me your website managment information ( admin url site, username and password ) in order for me to have access to know the exact issue. We will take it a lock on this help you.
Best Regards,
PenciDesign
Hi,
I custom attachment.php file on child theme help you. http://prntscr.com/ncz9w9, http://prntscr.com/ncza0q
Please check it and tell me about layout attachment you want change, i will check it help you.
Best Regards,
PenciDesign
Many thanks, that'll do the trick.
What I still don't understand is why the shorter url makes use of the pdf.php template but the other one appears in a totally different manner when attachment.php had the same code.
Hi,
I checked your image attachement . It seems that short link have mess ( sin adjuntar ) http://prntscr.com/ndauc4
Best Regards,
PenciDesign