I answer myself in order to help anyone else trying to achieve that kind of results.
First I’ve created a child theme…change the page which was showing the category for a page template I’ve created
In my case my page template was page-blog.php with this structure:
<?php /*
* Template Name: Blog dos columnas
*
*/
get_header(); ?>
<section id="container" class="two-columns-right">
<div id="content" role="main">
<?php get_template_part( 'content/content', 'blog'); ?>
</div><!-- #content -->
<?php get_sidebar('right'); ?>
</section><!-- #container -->
<?php get_footer(); ?>
Then another file under the folder: content.
This file has the query of my category, in my case i named it content-blog.php
<?php
/**
*
* Learn more: https://codex.www.ads-software.com/Post_Formats
*
* @package Cryout Creations
* @subpackage Nirvana
*/
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'category_name' =>'tech-blog',
'order' => DESC,
'post_per_page' => 6,
'paged' => $paged
);
query_posts($args);
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" class="page-blog">
<div class="imagen-blog"><?php the_post_thumbnail('blog'); ?></div>
<?php if ( is_front_page() ) { ?>
<h2 class="entry-title"><?php the_title(); ?></h2>
<?php } else { ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php } ?>
<div class="entry-content">
<div class="meta">
<p><?php the_date(); ?> - <?php the_author(); ?></p>
</div>
<div class="clear"></div>
<div class="separator-blog">
<?php the_excerpt(); ?></div>
<div style="clear:both;"></div>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'nirvana' ), 'after' => '</div>' ) ); ?>
<?php edit_post_link( __( 'Edit', 'nirvana' ), '<span class="edit-link"><i class="icon-edit"></i> ', '</span>' ); ?>
</div><!-- .entry-content -->
</div><!-- #post-## -->
<?php comments_template( '', true );
endwhile; ?>
<?php if($nirvana_pagination=="Enable") nirvana_pagination($the_query->max_num_pages); else nirvana_content_nav( 'nav-below' );
?>
And finally to show the single page with the sidebar too what i did was altering my functions.php to this:
add_action('template_include', 'load_single_template');
function load_single_template($template) {
$new_template = '';
// single post template
if( is_single() ) {
global $post;
if( has_term('tech-blog', 'category', $post) ) {
// use template file single-template-cat-1.php
$new_template = locate_template(array('single-template-cat-1.php' ));
}
}
return ('' != $new_template) ? $new_template : $template;
}
And created a file named: single-template-cat-1.php which has the sidebar in it!
Done…working perfect