Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi!
    Sorry for my English, but i try to help you with styling your links.

    In your code you can use get_attachment_link function instead the_attachment_link.

    So, let’s see your code:

    <?php
    $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_mime_type' => 'application/pdf, application/x-pdf, application/acrobat, applications/vnd.pdf, text/pdf, text/x-pdf, application/acad, application/x-acad, application/autocad_dwg, image/x-dwg, application/dwg, application/x-dwg, application/x-autocad, image/vnd.dwg, drawing/dwg, application/octet-stream', 'post_status' => null, 'post_parent' => $post->ID );
    $attachments = get_posts($args);
    if ($attachments) {
    	foreach ( $attachments as $attachment ) {
    		$al=get_attachment_link( $attachment->ID);
                    $at=get_the_title($attachment->ID);
                    echo "<a href=".$al." class='your_class_here'>".$at."</a>";
    	}
    }
    ?>

    In style.css define class your_class_here for styling.

    Hope, this method will help you.

Viewing 1 replies (of 1 total)