StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have -- and this forum will be removed on July 1st, 2013.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-27-2011, 06:57 AM
jonnyw jonnyw is offline
Registered User
Genesis Member
 
Join Date: Aug 2009
Posts: 72
Default Retrieving page attachment URL

Hi,
I’m trying to create a page template that shows the post title, excerpt and a link to the attachment.


I’ve been using this code:


Code:
<?php $args = array(     'post_type' ?> 'attachment',     'numberposts' => null,     'post_status' => null,     'post_parent' => $post->ID ); $attachments = get_posts($args); if ($attachments) {     foreach ($attachments as $attachment) {         echo apply_filters('the_title', $attachment->post_title);         the_attachment_link($attachment->ID, false);     } }?>
which is great and pulls the post attachment but it uses the document title as the link name like this:


POST TITLE / POST EXCERPT / DOCUMENT23 .DOC


How do I achieve this:


POST TITLE / POST EXCERPT / CLICK HERE TO DOWNLOAD



Any help much appreciated,


Thanks,


Jon.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Attachment.php / Image.php Page Help ruibo General Discussion 1 07-04-2009 10:21 PM


All times are GMT -5. The time now is 01:53 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.