• 1.
    <?php
  • 2.
    /**
  • 3.
     * The template for displaying question archive pages
  • 4.
     *
  • 5.
     * @package DW Question & Answer
  • 6.
     * @since DW Question & Answer 1.0.1
  • 7.
     */
  • 8.
    /* if ( isset( $_GET['test'] ) ) {
  • 9.
    	global $wp_query;
  • 10.
    	print_r( $wp_query->dwqa_questions );
  • 11.
    } */
  • 12.
    ?>
  • 13.
    <div class="dwqa-questions-archive">
  • 14.
    	<?php do_action( 'dwqa_before_questions_archive' ) ?>
  • 15.
    		<div class="dwqa-questions-header ask-qa-top">
  • 16.
    			<?php if ( dwqa_current_user_can( 'post_question' ) ) : ?>
  • 17.
    				<div class="dwqa-ask-question"><a href="<?php echo dwqa_get_ask_link(); ?>"><?php _e( 'Ask Question', 'dwqa' ); ?></a></div>
  • 18.
    			<?php endif; ?>
  • 19.
    		</div>
  • 20.
    		
  • 21.
    		<div class="dwqa-questions-list <?php echo !dwqa_is_enable_status()?'hidden-status':''?>">
  • 22.
    		<?php do_action( 'dwqa_before_questions_list' ) ?>
  • 23.
    		<?php if ( dwqa_has_question() ) : ?>
  • 24.
    			<?php while ( dwqa_has_question() ) : dwqa_the_question(); ?>
  • 25.
    				<?php if ( get_post_status() == 'publish' || ( ( get_post_status() == 'private' || get_post_status() == 'spam' ) && ( dwqa_current_user_can( 'edit_question', get_the_ID() ) || dwqa_current_user_can( 'manage_question' ) || get_current_user_id() == get_post_field( 'post_author', get_the_ID() ) ) ) ) : ?>
  • 26.
    					<?php dwqa_load_template( 'content', 'question' ) ?>
  • 27.
    				<?php endif; ?>
  • 28.
    			<?php endwhile; ?>
  • 29.
    		<?php else : ?>
  • 30.
    			<?php dwqa_load_template( 'content', 'none' ) ?>
  • 31.
    		<?php endif; ?>
  • 32.
    		<?php do_action( 'dwqa_after_questions_list' ) ?>
  • 33.
    		</div>
  • 34.
    		<div class="dwqa-questions-footer">
  • 35.
    			<?php dwqa_question_paginate_link() ?>
  • 36.
    			<?php if ( dwqa_current_user_can( 'post_question' ) ) : ?>
  • 37.
    				<div class="dwqa-ask-question"><a href="<?php echo dwqa_get_ask_link(); ?>"><?php _e( 'Ask Question', 'dwqa' ); ?></a></div>
  • 38.
    			<?php endif; ?>
  • 39.
    		</div>
  • 40.
     
  • 41.
    	<?php do_action( 'dwqa_after_questions_archive' ); ?>
  • 42.
    </div>
  • 43.
     
<?php /** * The template for displaying question archive pages * * @package DW Question & Answer * @since DW Question & Answer 1.0.1 */ /* if ( isset( $_GET['test'] ) ) { global $wp_query; print_r( $wp_query->dwqa_questions ); } */ ?> <div class="dwqa-questions-archive"> <?php do_action( 'dwqa_before_questions_archive' ) ?> <div class="dwqa-questions-header ask-qa-top"> <?php if ( dwqa_current_user_can( 'post_question' ) ) : ?> <div class="dwqa-ask-question"><a href="<?php echo dwqa_get_ask_link(); ?>"><?php _e( 'Ask Question', 'dwqa' ); ?></a></div> <?php endif; ?> </div> <div class="dwqa-questions-list <?php echo !dwqa_is_enable_status()?'hidden-status':''?>"> <?php do_action( 'dwqa_before_questions_list' ) ?> <?php if ( dwqa_has_question() ) : ?> <?php while ( dwqa_has_question() ) : dwqa_the_question(); ?> <?php if ( get_post_status() == 'publish' || ( ( get_post_status() == 'private' || get_post_status() == 'spam' ) && ( dwqa_current_user_can( 'edit_question', get_the_ID() ) || dwqa_current_user_can( 'manage_question' ) || get_current_user_id() == get_post_field( 'post_author', get_the_ID() ) ) ) ) : ?> <?php dwqa_load_template( 'content', 'question' ) ?> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <?php dwqa_load_template( 'content', 'none' ) ?> <?php endif; ?> <?php do_action( 'dwqa_after_questions_list' ) ?> </div> <div class="dwqa-questions-footer"> <?php dwqa_question_paginate_link() ?> <?php if ( dwqa_current_user_can( 'post_question' ) ) : ?> <div class="dwqa-ask-question"><a href="<?php echo dwqa_get_ask_link(); ?>"><?php _e( 'Ask Question', 'dwqa' ); ?></a></div> <?php endif; ?> </div> <?php do_action( 'dwqa_after_questions_archive' ); ?> </div>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter