Function: the_attachment_link ()
-
I’m working on a WP template and I would like make a feature in which the first image of a post is shown and the excerpt of the post is overlapped to the image on a opaque white background.
I know there are a lot of Plugins doing that, but I’d prefer to build my own template bottom up in order to deeply understand WP poetry ??
Unfortunately I am unable to retrieve attached image!
The first attempt was to use the_attachment_link() function. Following is the code:
<?php query_posts('posts_per_page=1'); ?> <?php if ( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php the_attachment_link(1); ?> <?php the_excerpt(); ?> <?php endif; ?>
Probably I did not really understand the differences between attached images and/or inserted images.
Can someone help?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Function: the_attachment_link ()’ is closed to new replies.