<?php
/**
* A Simple Category Template
*/
 
get_header(); 
//the_author_posts_link()
// category_description()
// single_cat_title( '', false )
//the_author_posts_link()
// the_title_attribute()
// the_permalink()
// the_content()
?> 
 
<section id="primary" class="site-content">
<div id="content" role="main">
<!--
<header class="archive-header">
</header> -->
<?php
$aplicarcss = get_option("nichecreator_aplicarcss");
if ($aplicarcss == 'Si')
{
wp_register_style('csscategories',plugins_url('../css/pages.css',__FILE__),'','1.0');
wp_enqueue_style('csscategories');
}
$category = get_queried_object();
$categoryid = $category->term_id;
 $ocultarh1 = get_option('nichecreator_ocultarh1');
if ($ocultarh1 == 'No')
	{
	$h1 = get_term_meta($categoryid,'textoh1',true);
	echo "<h1>$h1</h1>";
	}
	
echo '<div class="entry">';
$ocultardesc = get_option('nichecreator_ocultardesc');
if ($ocultardesc == 'No')
	{
	echo '<div class="descripcion">';
	$desc = category_description($categoryid);
	echo do_shortcode($desc);
	echo '</div>';
	}
$contenido = get_term_meta($categoryid,'contenido',true);
$pattern = get_shortcode_regex();
$contenido = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $contenido );
echo apply_filters( 'the_content', do_blocks($contenido) );
/*
if (has_blocks($contenido))
	{
	$blocks = parse_blocks($contenido);
	foreach ($blocks as $block)
		{
		echo render_block($block);
		}
	}
*/
$parrafoconc = get_term_meta($categoryid,'conclusion',true);
echo '<div class="concl">';
echo '<p>'.do_shortcode($parrafoconc).'</p>';
echo '</div>';
?>
</div>
 
 
</div>
</section>
<?php
$ocultarcats = get_option('nichecreator_ocultarcats');
if ($ocultarcats == 'No')
    get_sidebar();
get_footer(); 
?>
