How to create posts from the current category?

Hi, the essence of the task to display posts in the sidebar of the current category of the post.
Below code does the job , but :
1. Displays posts, not alphabetical order, and Vice versa.
2. It would be convenient to identify a post where you are and highlight it in bold in the array.
Help, can at whom was similar. Google has not helped.
<h3 class="widget-title">post category</h3>
<?php 
global $post;
$categories = get_the_category();
foreach($categories as $category) {
}
$catquery = new WP_Query( 'cat= '.$category->cat_ID.' &posts_per_page=50' ); ?>
the <ul>
<?php while($catquery->have_posts()) : $catquery->the_post(); ?>
<div class="sidebar_obor">
the <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
</div>
<?php endwhile;
wp_reset_postdata(); // http://qaru.site/questions/13455488/wordpress-query-ordering-by-parent-title
?>
March 19th 20 at 09:08
3 answers
March 19th 20 at 09:10
Solution
Approximately, wrote on the knee, and did not check, but the essence is this:
# id of the current directory
 $categories = get_the_category();
 $cat = $categories[0]->term_id;

 $args = array(
 'post_type' => 'post', // Display posts
 'posts_per_page' => 10, // Display 10 records
 'order' => 'DESC', // the sort order from highest to lowest ASC Vice-versa 
 'cat' => $cat, // Only the current directory
);


 $id_post_current = get_the_ID();
 $query = new WP_Query( $args );
 while ( $query->have_posts() ) { $query->the_post(); ?>
 <a href="<?php the_permalink(); ?>"> <?php
 if( $id_post_current == get_the_ID() ) { 
 ?> <b><?php the_title(); ?></b> <?php
 } else {
the_title();
 } ?>
 </a> <?php
}
 wp_reset_postdata(); // reset ?>
March 19th 20 at 09:12
March 19th 20 at 09:14
While waiting, doper. Thank you . The first option works too...
<h3 class="widget-title"> Title</h3>
<?php 
global $post;
$categories = get_the_category();
foreach($categories as $category) {
}
$catquery = new WP_Query( 'cat= '.$category->cat_ID.' &posts_per_page=100&orderby=title&order=ASC' ); ?>
the <ul>
<?php while($catquery->have_posts()) : $catquery->the_post(); ?>


<div class="sidebar_obor">
the <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
</div>

<?php endwhile;
 wp_reset_postdata(); 
?>

Find more questions by tags WordPress