/** * Ajust the current theme layout. * * This function sets the proper theme-layout and content-width, if not set. * The '2c-l-fixed' layout is set as the default for RTL * and '2c-r-fixed' layout for LTR. * * @uses Momtaz_Layouts::set_current_layout() Set the current layout. * @uses momtaz_set_content_width() Set the content width. * @access private * @return void * @since 1.3 */ function momtaz_adjust_current_layout() { if (!Momtaz_Layouts::get_current_layout()) { if (is_active_sidebar('primary')) { if (is_rtl()) { Momtaz_Layouts::set_current_layout('2c-l'); } else { Momtaz_Layouts::set_current_layout('2c-r'); } } else { Momtaz_Layouts::set_current_layout('1c'); } } if (!momtaz_get_content_width()) { $layout = Momtaz_Layouts::get_current_layout(); if ($layout && !empty($layout->content_width)) { momtaz_set_content_width($layout->content_width); } } }
<?php if (wp_attachment_is_image()) { ?> <div class="entry-attachment"> <div class="attachment attachment-image"> <figure class="wp-caption"> <a href="<?php echo esc_url(wp_get_attachment_url()); ?> " rel="attachment"> <?php echo wp_get_attachment_image(get_the_ID(), apply_filters('momtaz_attachment_image_size', array(momtaz_get_content_width(), 1024)), false, array('class' => 'aligncenter')); ?> </a> <?php if (has_excerpt()) { ?> <figcaption class="wp-caption-text"> <?php the_excerpt(); ?> </figcaption> <?php } ?>