PHP 8.2.31
Preview: attachment.php Size: 4.87 KB
/proc/self/root/home/nshryvcy/taramarriagebureau.com/wp-content/themes/planmyday/templates/attachment.php

<?php

// Disable direct call
if ( ! defined( 'ABSPATH' ) ) { exit; }


/* Theme setup section
-------------------------------------------------------------------- */

if ( !function_exists( 'planmyday_template_attachment_theme_setup' ) ) {
	add_action( 'planmyday_action_before_init_theme', 'planmyday_template_attachment_theme_setup', 1 );
	function planmyday_template_attachment_theme_setup() {
		planmyday_add_template(array(
			'layout' => 'attachment',
			'mode'   => 'internal',
			'title'  => esc_html__('Attachment page layout', 'planmyday'),
			'thumb_title'  => esc_html__('Fullwidth image', 'planmyday'),
			'w'		 => 1170,
			'h'		 => null,
			'h_crop' => 659
		));
	}
}

// Template output
if ( !function_exists( 'planmyday_template_attachment_output' ) ) {
	function planmyday_template_attachment_output($post_options, $post_data) {
		$post_data['post_views']++;
		$title_tag = planmyday_get_custom_option('show_page_title')=='yes' ? 'h3' : 'h1';
		?>
		<article <?php post_class('post_item post_item_attachment template_attachment'); ?>>
		
			<<?php echo esc_html($title_tag); ?> class="post_title"><span class="post_icon <?php echo esc_attr($post_data['post_icon']); ?>"></span><?php echo !empty($post_data['post_excerpt']) ? strip_tags($post_data['post_excerpt']) : $post_data['post_title']; ?></<?php echo esc_html($title_tag); ?>>

			<div class="post_featured">
				<div class="post_thumb post_nav" data-image="<?php echo esc_url($post_data['post_attachment']); ?>" data-title="<?php echo esc_attr($post_data['post_title']); ?>">
					<?php
					planmyday_show_layout($post_data['post_thumb']);
					$post = get_post();
					$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
					if (is_array($attachments) && count($attachments) > 0) {
						foreach ($attachments as $k => $attachment) {
							if ( $attachment->ID == $post->ID )
								break;
						}
					}
					if ( isset( $attachments[ $k-1 ] ) ) {
						$link = get_permalink( $attachments[ $k-1 ]->ID ).'#top_of_page';
						$desc = planmyday_strshort(!empty($attachments[ $k-1 ]->post_excerpt) ? $attachments[ $k-1 ]->post_excerpt : $attachments[ $k-1 ]->post_title, 30);
						?>
						<a class="post_nav_item post_nav_prev" href="<?php echo esc_url($link); ?>">
							<span class="post_nav_info">
								<span class="post_nav_info_title"><?php esc_html_e('Previous item', 'planmyday'); ?></span>
								<span class="post_nav_info_description"><?php planmyday_show_layout($desc); ?></span>
							</span>
						</a>
						<?php
					}
					if ( isset( $attachments[ $k+1 ] ) ) {
						$link = get_permalink( $attachments[ $k+1 ]->ID ).'#top_of_page';
						$desc = planmyday_strshort(!empty($attachments[ $k+1 ]->post_excerpt) ? $attachments[ $k+1 ]->post_excerpt : $attachments[ $k+1 ]->post_title, 30);
						?>
						<a class="post_nav_item post_nav_next" href="<?php echo esc_url($link); ?>">
							<span class="post_nav_info">
								<span class="post_nav_info_title"><?php esc_html_e('Next item', 'planmyday'); ?></span>
								<span class="post_nav_info_description"><?php planmyday_show_layout($desc); ?></span>
							</span>
						</a>
						<?php
					}
					?>
				</div>
			</div>
		
			<?php
			if (!$post_data['post_protected'] && planmyday_get_custom_option('show_post_info')=='yes') {
				planmyday_template_set_args('post-info', array(
					'post_options' => $post_options,
					'post_data' => $post_data
				));
				require get_template_directory().'/templates/_parts/post-info.php';
			}
			?>
		
			<div class="post_content">
				<?php
				// Post content
				if ($post_data['post_protected']) { 
					planmyday_show_layout($post_data['post_excerpt']);
				} else {
					echo !empty($post_data['post_content']) ? trim($post_data['post_content']) : esc_html__('No image description ...', 'planmyday'); 
					wp_link_pages( array( 
						'before' => '<div class="nav_pages_parts"><span class="pages">' . esc_html__( 'Pages:', 'planmyday' ) . '</span>', 
						'after' => '</div>',
						'link_before' => '<span class="page_num">',
						'link_after' => '</span>'
					) ); 
					
					if ( planmyday_get_custom_option('show_post_tags') == 'yes' && !empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links)) {
						?>
						<div class="post_info post_info_bottom">
							<span class="post_info_item post_info_tags"><?php esc_html_e('Tags:', 'planmyday'); ?> <?php echo join(', ', $post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms_links); ?></span>
						</div>
						<?php 
					}
				}
				?>
			
			</div>	<!-- /.post_content -->
		
		</article>

		<section class="related_wrap related_wrap_empty"></section>

		<?php	
		// Show comments
		if ( !$post_data['post_protected'] && (comments_open() || get_comments_number() != 0) ) {
			comments_template();
		}
	}
}
?>

Directory Contents

Dirs: 8 × Files: 12

Name Size Perms Modified Actions
headers DIR
- drwxr-xr-x 2025-04-30 03:18:26
Edit Download
- drwxr-xr-x 2025-04-30 03:18:26
Edit Download
trx_form DIR
- drwxr-xr-x 2025-04-30 03:18:26
Edit Download
- drwxr-xr-x 2025-04-30 03:18:26
Edit Download
- drwxr-xr-x 2025-04-30 03:18:26
Edit Download
trx_team DIR
- drwxr-xr-x 2025-04-30 03:18:26
Edit Download
- drwxr-xr-x 2025-04-30 03:18:26
Edit Download
_parts DIR
- drwxr-xr-x 2025-04-30 03:18:26
Edit Download
1.52 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
4.87 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
5.17 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
6.18 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
6.28 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
1.38 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
1.45 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
16.38 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
3.75 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
5.43 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
8.14 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download
7.46 KB lrw-r--r-- 2025-04-30 03:18:26
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).