quartarolo replied
Thank you so much for your help, it exceeded all my expectations. it is perfect.
I now believe that you can set this function as default in your theme.
Thank you! your theme is fantastic
Hi friend, I really need your help. A very important function of my site is the function of page attachment.
I read here in the forum, only 2 similar questions.
how can i create the attachment.php file correctly
The main idea I'm following is as follows,
I take the single.php file and duplicate it, then rename it to attachment.php
But in this file there is an instruction to get "<? Php get_template_part ('template-parts / content', 'single');?>”
So I renamed the "single" part and changed it to attachment, while creating a new duplicate file from this one, named "content-attachment.php" from the "template-parts" folder.
So this file is also pointing to another "$ single_style = $ single_style? $ Single_style: 'style-1';"
Once again I duplicated the file “style-1” to “style-11” for example so that I could modify and place the code that makes the attachment image appear.
But again arriving at the file "style-11" where in the part of appearing the content I am taken one more way.
"get_template_part ('template-parts / single / entry-content');
?> ”
so this seems to be the last file, because only google ads code appears there.
I know my explanation is confusing. but deep down I can't put this default code that I use in other themes.
<? php}?>
<? php echo the_attachment_link (get_the_ID (), 'full'); ?>
<? php
$ id = (0); // ID of an attachment
echo wp_get_attachment_link ($ id, '', false, false, '<h1> Click to download </h1>');
?>
<? php the_content (); ?>
Want to join this conversation or access attachments? Sign in first.
Open your ticket archive, review validated licenses, and continue product support conversations from one customer portal.