Image will not appear on attachment page
-
Hello,
On my artist website I would like to use an attachment page in order to show more information about works from my gallery pages. I did and named it attachment.php. But ran into a bit of a problem.This is what I found and how things stand thus far:
1 The file page.php is used by the site instead of attachment.php.
2 It does give the same function as an attachment file but I want to make some changes and page.php can be used other places.
3 I built an attachment.php file (well, I copied page.php and renamed it attachment.php).
4 The changes I made work well, the Comments dialog box is now in the sidebar.
5 The problem: the image I want to show not longer appears.Here is the code that I think is where the problem is:
<?php if(have_posts()):?> <?php while(have_posts()): the_post(); get_template_part('inc/theme/views/content-page'); ?> ****have posts****<br> <?php endwhile; else:?> ****no posts****<br> <?php get_template_part('inc/theme/views/content-none'); endif; ?>
You can see on the webpage I am referencing that I put markers in the code. In the snippet above the “have posts” note shows and “no posts” does not.
Looking at the functions involved [(have_posts() and get_template_part()] didn’t help because I don’t really understand what I am reading.
Maybe it would be easier to test the webpage as it loads to see if it is an attachment page. I would have to skip over the Comments and the sidebar call in the body of the page and put them to the sidebar. The problem is I don’t know what to test for.
The page I need help with: [log in to see the link]
- The topic ‘Image will not appear on attachment page’ is closed to new replies.