122 lines
7.4 KiB
PHP
122 lines
7.4 KiB
PHP
<?php
|
|
/**
|
|
* قالب نمایش یک سند داکیومنت — تم Hesabix2
|
|
*
|
|
* @package Hesabix2
|
|
*/
|
|
$skip_sidebar = ( get_post_meta( $post->ID, 'skip_sidebar', true ) == 'yes' ) ? true : false;
|
|
|
|
get_header();
|
|
?>
|
|
|
|
<?php do_action( 'wedocs_before_main_content' ); ?>
|
|
|
|
<?php while ( have_posts() ) {
|
|
the_post(); ?>
|
|
|
|
<div class="wedocs-single-wrap flex flex-col lg:flex-row gap-8 lg:gap-10 bg-white rounded-3xl shadow-lg border border-slate-100 overflow-hidden">
|
|
|
|
<?php if ( ! $skip_sidebar ) { ?>
|
|
<?php wedocs_get_template_part( 'docs', 'sidebar', [ 'post' => $post ] ); ?>
|
|
<?php } ?>
|
|
|
|
<div class="wedocs-single-content flex-1 min-w-0 px-6 sm:px-8 pb-8 lg:py-8">
|
|
<?php wedocs_breadcrumbs(); ?>
|
|
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class( 'wedocs-article' ); ?> itemscope itemtype="http://schema.org/Article">
|
|
<header class="entry-header border-b border-slate-100 pb-6 mb-6">
|
|
<h1 class="entry-title text-2xl sm:text-3xl font-bold text-slate-800 mb-4" itemprop="headline"><?php the_title(); ?></h1>
|
|
|
|
<?php if ( wedocs_get_general_settings( 'print', 'on' ) === 'on' ) { ?>
|
|
<a
|
|
href="#"
|
|
class="wedocs-print-article wedocs-hide-print wedocs-hide-mobile inline-flex items-center gap-2 text-sm text-slate-500 hover:text-brand-600 transition-colors"
|
|
title="<?php echo esc_attr( __( 'Print this article', 'wedocs' ) ); ?>"
|
|
>
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/></svg>
|
|
<?php esc_html_e( 'چاپ', 'wedocs' ); ?>
|
|
</a>
|
|
<?php } ?>
|
|
</header>
|
|
|
|
<div class="entry-content text-slate-600 leading-relaxed prose prose-slate max-w-none wedocs-entry-content" itemprop="articleBody">
|
|
<?php
|
|
the_content( sprintf(
|
|
wp_kses( __( 'Continue reading %s <span class="meta-nav">→</span>', 'wedocs' ), [ 'span' => [ 'class' => [] ] ] ),
|
|
the_title( '<span class="screen-reader-text">"', '"</span>', false )
|
|
) );
|
|
|
|
wp_link_pages( [
|
|
'before' => '<div class="page-links mt-6">' . esc_html__( 'Docs:', 'wedocs' ),
|
|
'after' => '</div>',
|
|
] );
|
|
|
|
$children = wp_list_pages( 'title_li=&order=menu_order&child_of=' . $post->ID . '&echo=0&post_type=' . $post->post_type );
|
|
|
|
if ( $children ) {
|
|
echo '<div class="article-child mt-10 p-6 bg-light-50 rounded-2xl border border-slate-200">';
|
|
echo '<h3 class="text-lg font-bold text-slate-800 mb-4">' . esc_html__( 'مقالات مرتبط', 'wedocs' ) . '</h3>';
|
|
echo '<ul class="space-y-2 wedocs-child-list">';
|
|
echo $children;
|
|
echo '</ul>';
|
|
echo '</div>';
|
|
}
|
|
|
|
$tags_list = wedocs_get_the_doc_tags( $post->ID, '', ', ' );
|
|
|
|
if ( $tags_list ) {
|
|
printf( '<div class="tags-links mt-8 pt-6 border-t border-slate-200 text-sm text-slate-500"><span class="font-medium text-slate-700">%1$s </span>%2$s</div>',
|
|
_x( 'برچسبها:', 'Used before tag names.', 'wedocs' ),
|
|
$tags_list
|
|
);
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
<?php wedocs_doc_nav(); ?>
|
|
|
|
<footer class="entry-footer wedocs-entry-footer mt-10 pt-8 border-t border-slate-100">
|
|
<?php if ( wedocs_get_general_settings( 'email', 'on' ) === 'on' ) { ?>
|
|
<div class="help-content wedocs-hide-mobile flex flex-wrap items-center gap-4 p-4 bg-gradient-to-l from-brand-500/10 to-accent-500/10 rounded-2xl border border-brand-500/20">
|
|
<span class="help-icon flex-shrink-0 w-12 h-12 rounded-xl bg-brand-500/20 flex items-center justify-center">
|
|
<svg class="w-6 h-6 text-brand-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/></svg>
|
|
</span>
|
|
<div class="wedocs-help-link wedocs-hide-print text-slate-600 text-sm">
|
|
<?php printf( '%s <a id="wedocs-stuck-modal" href="%s" class="font-semibold text-brand-600 hover:text-brand-500 transition-colors">%s</a>', __( 'سوالی دارید؟ ', 'wedocs' ), '#', __( 'با ما در تماس باشید', 'wedocs' ) ); ?>
|
|
<div class="wedocs-article-author mt-1" itemprop="author" itemscope itemtype="https://schema.org/Person">
|
|
<meta itemprop="name" content="<?php echo esc_attr( get_the_author() ); ?>" />
|
|
<meta itemprop="url" content="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" />
|
|
</div>
|
|
<time class="text-slate-500 text-xs mt-1 block" itemprop="dateModified" datetime="<?php echo esc_attr( get_the_modified_date( 'c' ) ); ?>"><?php printf( __( 'آخرین بهروزرسانی: %s', 'wedocs' ), get_the_modified_date() ); ?></time>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ( wedocs_get_general_settings( 'helpful', 'on' ) === 'on' ) { ?>
|
|
<div class="feedback-content mt-6">
|
|
<?php wedocs_get_template_part( 'content', 'feedback' ); ?>
|
|
</div>
|
|
<?php } ?>
|
|
</footer>
|
|
|
|
<?php if ( wedocs_get_general_settings( 'email', 'on' ) === 'on' ) { ?>
|
|
<?php wedocs_get_template_part( 'content', 'modal' ); ?>
|
|
<?php } ?>
|
|
|
|
<?php if ( wedocs_get_general_settings( 'comments', 'off' ) === 'on' ) { ?>
|
|
<?php if ( comments_open() || get_comments_number() ) { ?>
|
|
<div class="wedocs-comments-wrap mt-10">
|
|
<?php comments_template(); ?>
|
|
</div>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
|
|
</article>
|
|
</div>
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
<?php do_action( 'wedocs_after_main_content' ); ?>
|
|
|
|
<?php get_footer(); ?>
|