Skip to content

Instantly share code, notes, and snippets.

@aristath
Last active August 11, 2017 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aristath/5003078 to your computer and use it in GitHub Desktop.
Save aristath/5003078 to your computer and use it in GitHub Desktop.
<?php get_header(); ?>
<?php
// Check and get Sidebar Class
$sidebar = get_post_meta($post->ID,'post-option-sidebar-template',true);
if( empty($sidebar) ){
global $default_post_sidebar;
$sidebar = $default_post_sidebar;
}
$sidebar_array = gdl_get_sidebar_size( $sidebar );
// Translator words
if( $gdl_admin_translator == 'enable' ){
$translator_about_author = get_option(THEME_SHORT_NAME.'_translator_about_author', 'About the Author');
$translator_social_share = get_option(THEME_SHORT_NAME.'_translator_social_shares', 'Social Share');
}else{
$translator_about_author = __('About the Author','gdl_front_end');
$translator_social_share = __('Social Share','gdl_front_end');
}
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="page-wrapper single-blog <?php echo $sidebar_array['sidebar_class']; ?>">
<?php
global $left_sidebar, $right_sidebar, $default_post_left_sidebar, $default_post_right_sidebar;
$left_sidebar = get_post_meta( $post->ID , "post-option-choose-left-sidebar", true);
$right_sidebar = get_post_meta( $post->ID , "post-option-choose-right-sidebar", true);
if( empty( $left_sidebar )){ $left_sidebar = $default_post_left_sidebar; }
if( empty( $right_sidebar )){ $right_sidebar = $default_post_right_sidebar; }
global $blog_single_size, $sidebar_type;
$item_size = $blog_single_size[$sidebar_type];
// starting the content
echo '<div class="row gdl-page-row-wrapper">';
echo '<div class="gdl-page-left mb0 ' . $sidebar_array['page_left_class'] . '">';
echo '<div class="row">';
echo '<div class="gdl-page-item mb0 pb20 gdl-blog-full ' . $sidebar_array['page_item_class'] . '">';
echo '<div class="blog-content-wrapper">';
// blog content
echo '<div class="blog-content">'; ?>
<div id="qa-page-wrapper">
<div id="qa-content-wrapper">
<?php do_action( 'qa_before_content', 'archive-question' ); ?>
<?php the_qa_error_notice(); ?>
<?php the_qa_menu(); ?>
<?php if ( !have_posts() ) : ?>
<p><?php $question_ptype = get_post_type_object( 'question' ); echo $question_ptype->labels->not_found; ?></p>
<?php else: ?>
<div id="question-list">
<?php while ( have_posts() ) : the_post(); ?>
<?php do_action( 'qa_before_question_loop' ); ?>
<div class="question">
<?php do_action( 'qa_before_question' ); ?>
<div class="question-stats">
<?php do_action( 'qa_before_question_stats' ); ?>
<div class="qa-status-icon <?php echo (is_question_answered())?'qa-answered-icon':'qa-unanswered-icon'; ?>"></div>
<?php the_question_score(); ?>
<?php the_question_status(); ?>
<?php do_action( 'qa_after_question_stats' ); ?>
</div>
<div class="question-summary">
<?php do_action( 'qa_before_question_summary' ); ?>
<h3><?php the_question_link(); ?></h3>
<?php the_question_tags( '<div class="question-tags">', ' ', '</div>' ); ?>
<div class="question-started">
<?php the_qa_time( get_the_ID() ); ?>
<?php the_qa_user_link( $post->post_author ); ?>
</div>
<?php do_action( 'qa_after_question_summary' ); ?>
</div>
<?php do_action( 'qa_after_question' ); ?>
</div>
<?php do_action( 'qa_after_question_loop' ); ?>
<?php endwhile; $wp_query->set('posts_per_page', 6); ?>
</div><!--#question-list-->
<?php the_qa_pagination( ); ?>
<?php do_action( 'qa_after_content', 'archive-question' ); ?>
<?php endif;?>
</div>
</div><!--#qa-page-wrapper-->
<?php
wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'gdl_front_end' ) . '</span>', 'after' => '</div>' ) );
echo '<div class="clear"></div>';
echo '</div>';
echo '</div>'; // blog content wrapper
echo "</div>"; // end of gdl-page-item
get_sidebar('left');
echo '<div class="clear"></div>';
echo "</div>"; // row
echo "</div>"; // gdl-page-left
get_sidebar('right');
echo '<div class="clear"></div>';
echo "</div>"; // row
?>
<div class="clear"></div>
</div> <!-- page wrapper -->
</div> <!-- post class -->
<?php get_footer(); ?>
<?php get_header(); ?>
<?php
// Check and get Sidebar Class
$sidebar = get_post_meta($post->ID,'post-option-sidebar-template',true);
if( empty($sidebar) ){
global $default_post_sidebar;
$sidebar = $default_post_sidebar;
}
$sidebar_array = gdl_get_sidebar_size( $sidebar );
// Translator words
if( $gdl_admin_translator == 'enable' ){
$translator_about_author = get_option(THEME_SHORT_NAME.'_translator_about_author', 'About the Author');
$translator_social_share = get_option(THEME_SHORT_NAME.'_translator_social_shares', 'Social Share');
}else{
$translator_about_author = __('About the Author','gdl_front_end');
$translator_social_share = __('Social Share','gdl_front_end');
}
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="page-wrapper single-blog <?php echo $sidebar_array['sidebar_class']; ?>">
<?php
global $left_sidebar, $right_sidebar, $default_post_left_sidebar, $default_post_right_sidebar;
$left_sidebar = get_post_meta( $post->ID , "post-option-choose-left-sidebar", true);
$right_sidebar = get_post_meta( $post->ID , "post-option-choose-right-sidebar", true);
if( empty( $left_sidebar )){ $left_sidebar = $default_post_left_sidebar; }
if( empty( $right_sidebar )){ $right_sidebar = $default_post_right_sidebar; }
global $blog_single_size, $sidebar_type;
$item_size = $blog_single_size[$sidebar_type];
// starting the content
echo '<div class="row gdl-page-row-wrapper">';
echo '<div class="gdl-page-left mb0 ' . $sidebar_array['page_left_class'] . '">';
echo '<div class="row">';
echo '<div class="gdl-page-item mb0 pb20 gdl-blog-full ' . $sidebar_array['page_item_class'] . '">';
if ( have_posts() ){
while (have_posts()){
the_post();
echo '<div class="blog-content-wrapper">';
// blog content
echo '<div class="blog-content">'; ?>
<div id="qa-page-wrapper" style="float: none;">
<div id="qa-content-wrapper">
<?php do_action( 'qa_before_content', 'single-question' ); ?>
<?php the_qa_menu(); ?>
<?php if ( ($user_ID == 0 && qa_visitor_can('read_questions')) || current_user_can( 'read_questions' ) ) { ?>
<?php wp_reset_postdata(); ?>
<div id="single-question">
<h1><?php the_title(); ?></h1>
<div id="single-question-container">
<?php the_question_voting(); ?>
<div id="question-body">
<div id="question-content"><?php echo the_content(); ?></div>
<?php the_question_category( __( 'Category:', QA_TEXTDOMAIN ) . ' <span class="question-category">', '', '</span>' ); ?>
<?php the_question_tags( __( 'Tags:', QA_TEXTDOMAIN ) . ' <span class="question-tags">', ' ', '</span>' ); ?>
<span id="qa-lastaction"><?php _e( 'asked', QA_TEXTDOMAIN ); ?> <?php the_qa_time( get_the_ID() ); ?></span>
<div class="question-meta">
<?php do_action( 'qa_before_question_meta' ); ?>
<?php the_qa_action_links( get_the_ID() ); ?>
<?php the_qa_author_box( get_the_ID() ); ?>
<?php do_action( 'qa_after_question_meta' ); ?>
</div>
</div>
</div>
</div>
<?php } ?>
<?php if ( (( ($user_ID == 0 && qa_visitor_can('read_answers')) || current_user_can( 'read_answers' )) ) && is_question_answered() ) { ?>
<div id="answer-list">
<?php do_action( 'qa_before_answers' ); ?>
<h2><?php the_answer_count(); ?></h2>
<?php the_answer_list(); ?>
<?php do_action( 'qa_after_answers' ); ?>
</div>
<?php } ?>
<?php if ( ($user_ID == 0 && qa_visitor_can('publish_answers')) || current_user_can( 'publish_answers' ) ) { ?>
<div id="edit-answer">
<?php do_action( 'qa_before_edit_answer' ); ?>
<h2><?php _e( 'Your Answer', QA_TEXTDOMAIN ); ?></h2>
<?php the_answer_form(); ?>
<?php do_action( 'qa_after_edit_answer' ); ?>
</div>
<?php } ?>
<p><?php the_question_subscription(); ?></p>
<?php do_action( 'qa_after_content', 'single-question' ); ?>
</div>
</div><!--#qa-page-wrapper-->
<?php
wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'gdl_front_end' ) . '</span>', 'after' => '</div>' ) );
echo '<div class="clear"></div>';
echo '</div>';
// Include Social Shares
if(get_post_meta($post->ID, 'post-option-social-enabled', true) != "No"){
echo "<h3 class='social-share-title'>" . $translator_social_share . '</h3>';
include_social_shares();
echo "<div class='clear'></div>";
}
echo '</div>'; // blog content wrapper
}
}
echo "</div>"; // end of gdl-page-item
get_sidebar('left');
echo '<div class="clear"></div>';
echo "</div>"; // row
echo "</div>"; // gdl-page-left
get_sidebar('right');
echo '<div class="clear"></div>';
echo "</div>"; // row
?>
<div class="clear"></div>
</div> <!-- page wrapper -->
</div> <!-- post class -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment