Skip to content
Public Ticket #7146

Attachment Page

Conversation thread

Muhammad Jahangir replied

Customer Reply

Done. closed this ticket now.

Thanks

Penci Design replied

Staff Reply

Hi,

I checked and add custom code to function.php file to do that:

function modify_attachment_link( $markup, $id, $size, $permalink, $icon, $text )
{
    $_post = get_post( $id );      $size = 'full';     if ( empty( $_post ) || ( 'attachment' !== $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) ) {
        return __( 'Missing Attachment' );
    }     if ( $permalink ) {
        $url = get_attachment_link( $_post->ID );
    }     if ( $text ) {
        $link_text = $text;
    } elseif ( $size && 'none' != $size ) {
        $link_text = wp_get_attachment_image( $_post->ID, $size, $icon, $attr );
    } else {
        $link_text = '';
    }     if ( '' === trim( $link_text ) ) {
        $link_text = $_post->post_title;
    }     if ( '' === trim( $link_text ) ) {
        $link_text = esc_html( pathinfo( get_attached_file( $_post->ID ), PATHINFO_FILENAME ) );
    }     return "<a href='" . esc_url( $url ) . "'>$link_text</a>";
} add_filter( 'wp_get_attachment_link', 'modify_attachment_link', 10, 6 );

Please check it again.

Best Regards,

PenciDesign

Penci Design replied

Staff Reply

Hi,

Please  send me your website managment information ( admin url site, username and password ) in order for me to have access to know the exact issue. We will take it a lock on this help you.

Best Regards,

PenciDesign

Penci Design replied

Staff Reply

Hi,

Please open  PenNews theme folder, then copy single.php file then rename to "single-attachment.php" file

then add custom code to file  as screenshot http://prntscr.com/msieet

Best Regards,

PenciDesign

Want to join this conversation or access attachments? Sign in first.