57 lines
2.9 KiB
PHP
57 lines
2.9 KiB
PHP
<?php
|
|
/**
|
|
* قالب پایه AnsPress — سازگار با hesabix2
|
|
*
|
|
* @package Hesabix2
|
|
* @subpackage AnsPress
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
get_header();
|
|
|
|
$hesabix2_ap_is_single = function_exists( 'is_question' ) && is_question();
|
|
$hesabix2_ap_ask_url = function_exists( 'ap_get_link_to' ) ? ap_get_link_to( 'ask' ) : '';
|
|
$hesabix2_ap_mobile_primary_href = $hesabix2_ap_is_single ? '#answer-form-c' : $hesabix2_ap_ask_url;
|
|
$hesabix2_ap_mobile_primary_label = $hesabix2_ap_is_single
|
|
? __( 'پاسخ دهید', 'hesabix2' )
|
|
: __( 'سوال جدید', 'hesabix2' );
|
|
?>
|
|
|
|
<main id="main-content" class="site-main anspress-main">
|
|
<div class="anspress-wrap max-w-6xl mx-auto px-3 sm:px-4 lg:px-6 py-4 sm:py-6 pb-24 lg:pb-6">
|
|
<?php
|
|
while ( have_posts() ) :
|
|
the_post();
|
|
the_content();
|
|
endwhile;
|
|
?>
|
|
</div>
|
|
|
|
<?php if ( $hesabix2_ap_is_single ) : ?>
|
|
<?php if ( ! is_user_logged_in() ) : ?>
|
|
<div class="hesabix2-ap-mobile-bar lg:hidden" role="region" aria-label="<?php esc_attr_e( 'اقدام سریع', 'hesabix2' ); ?>">
|
|
<a href="<?php echo esc_url( function_exists( 'hesabix2_anspress_login_url' ) ? hesabix2_anspress_login_url( get_permalink() ) : wp_login_url( get_permalink() ) ); ?>" class="hesabix2-ap-mobile-bar__btn"><?php esc_html_e( 'ورود برای پاسخ', 'hesabix2' ); ?></a>
|
|
<a href="<?php echo esc_url( function_exists( 'hesabix2_anspress_base_url' ) ? hesabix2_anspress_base_url() : home_url( '/' ) ); ?>" class="hesabix2-ap-mobile-bar__secondary"><?php esc_html_e( 'لیست', 'hesabix2' ); ?></a>
|
|
</div>
|
|
<?php elseif ( function_exists( 'ap_user_can_answer' ) && ap_user_can_answer( get_question_id() ) ) : ?>
|
|
<div class="hesabix2-ap-mobile-bar lg:hidden" role="region" aria-label="<?php esc_attr_e( 'اقدام سریع', 'hesabix2' ); ?>">
|
|
<a href="#answer-form-c" class="hesabix2-ap-mobile-bar__btn"><?php esc_html_e( 'پاسخ دهید', 'hesabix2' ); ?></a>
|
|
<a href="<?php echo esc_url( function_exists( 'hesabix2_anspress_base_url' ) ? hesabix2_anspress_base_url() : home_url( '/' ) ); ?>" class="hesabix2-ap-mobile-bar__secondary"><?php esc_html_e( 'لیست', 'hesabix2' ); ?></a>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php elseif ( $hesabix2_ap_ask_url ) : ?>
|
|
<div class="hesabix2-ap-mobile-bar lg:hidden" role="region" aria-label="<?php esc_attr_e( 'اقدام سریع', 'hesabix2' ); ?>">
|
|
<?php if ( function_exists( 'ap_user_can_ask' ) && ap_user_can_ask() ) : ?>
|
|
<a href="<?php echo esc_url( $hesabix2_ap_ask_url ); ?>" class="hesabix2-ap-mobile-bar__btn"><?php esc_html_e( 'سوال جدید', 'hesabix2' ); ?></a>
|
|
<?php else : ?>
|
|
<a href="<?php echo esc_url( function_exists( 'hesabix2_anspress_login_url' ) ? hesabix2_anspress_login_url( $hesabix2_ap_ask_url ) : wp_login_url( $hesabix2_ap_ask_url ) ); ?>" class="hesabix2-ap-mobile-bar__btn"><?php esc_html_e( 'ورود برای پرسیدن', 'hesabix2' ); ?></a>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</main>
|
|
|
|
<?php
|
|
get_footer();
|