• Hi!

    Could you tell me if it’s possible to further customize the output?

    I’d like to make several attachment blocks each look like the block in the upper right corner (which is standard WP attachment).

    Using filtering I managed to create a custom template.

    function dg_gallery_template($gallery, $use_descriptions) {
         if ( $use_descriptions ) {
    
             $gallery = '<div class="row">
    		<div class="medium-7 cell back-blue">
    			<div class="tabs-content custom" data-tabs-content="doc-tabs">%rows%</div></div>
    			
    			<div class="toc medium-5 cell"><ul class="vertical tabs custom" data-tabs role="tablist" id="doc-tabs">%rows%</ul></div>
    		
    			</div>';
         }
         return $gallery;
     }
     add_filter( 'dg_gallery_template', 'dg_gallery_template', 10, 2 );
    
     function dg_row_template($row, $use_descriptions) {
         if ( $use_descriptions ) {
             $row = '%icons%';
         }
         return $row;
     }
     add_filter( 'dg_row_template', 'dg_row_template', 10, 2 );
    
     function dg_icon_template($icon, $use_descriptions, $id) {
         if ( $use_descriptions ) {
             $icon = '<div class="tabs-panel is-active" id="panel_01"><img src="%img%" title="%title_attribute%" alt="%title_attribute%" %data%/>
             
             <a class="button btn-yellow" href="%link%" target="%target%">Скачать</a></div>';
         }
         return $icon;
     }
     
     
     add_filter( 'dg_icon_template', 'dg_icon_template', 10, 3 );

    But I found out that I need to loop through the attachments (first for the pane content, than for the pane tab).

    Is it possible? Also, if there any attachment_id variable? Couldn’t find any in the class-document.php?

    The page I need help with: [log in to see the link]

  • The topic ‘Further template customization’ is closed to new replies.