<?php
include('../../../wp-load.php');
if(isset($_POST['book']) && !empty($_POST['book'])):
	$args = array( 'posts_per_page' => -1,'category' => $_POST['book'],'orderby'=> 'date','order'      => 'ASC');
	$posts = get_posts($args);
	$counter=0;
	foreach($posts as $post):
		setup_postdata( $post );
	?>
		<li class=" canonical">
			<a href="<?php echo get_permalink();?>"><?php echo ++$counter;?></a>
		</li>
	<?php
	endforeach;
endif;

if(isset($_POST['other_cat']) && !empty($_POST['other_cat'])):?>
	<div class="mobile">
				<div class="reader_modal_header">
					<nav>
						<a class="close_btn version_close_btn">X</a>
					</nav>
				</div>
			</div>
			<div style="display: none;" class="spinner_wrapper">
				<div id="version_spinner" class="dynamic_menu_spinner"></div>
			</div>
			<div class="browse">
				<span class="menu_arrow">&nbsp;</span>
				<ul class="other">
					<?php $cat_id	=	get_cat_ID($_POST['other_cat']) ?>
					<?php $args = array(
								  'orderby' => 'name',
								  'order' => 'ASC',
								  'child_of'=>$cat_id,
								  'hide_empty'=>0
								  ); 
							?>
					<?php  $categories = get_categories($args); ?>
					<?php foreach($categories as $category):?>
						<li data-meta="<?php echo $category->name;?>">
							<a href="javascript:void(0)" data-book="<?php echo $category->term_id;?>"><?php echo $category->name;?></a>
						</li>
						
					<?php endforeach;?>
				</ul>
			</div>
<?php endif;?>

<?php 
	if(isset($_POST['size_options']) && !empty($_POST['size_options'])):
		$bible_font_size = get_option( 'bible_font_size' ); 
		if(empty($bible_font_size)):
			add_option('bible_font_size', $_POST['size_options']);
		else:
			update_option('bible_font_size', $_POST['size_options']);;
		endif;
	endif;
	echo $_POST['style_options'];
	if(isset($_POST['style_options']) && !empty($_POST['style_options'])):
		$bible_font_style = get_option( 'bible_font_style' ); 
		if(empty($bible_font_style)):
			add_option('bible_font_style', $_POST['style_options']);
		else:
			update_option('bible_font_style', $_POST['style_options']);;
		endif;
	endif;
	echo $_POST['theme_color'];
	if(isset($_POST['theme_color']) && !empty($_POST['theme_color'])):
		$bible_theme_color = get_option( 'bible_theme_color' ); 
		if(empty($bible_theme_color)):
			add_option('bible_theme_color', $_POST['theme_color']);
		else:
			update_option('bible_theme_color', $_POST['theme_color']);;
		endif;
	endif;

?>