Special PHP code for category and the plugin
-
Hello,
I used the plugin q translate X for my website, and it works very well, I’m really happy, but I’ve a problem.
I used a PHP code found on a site to have sidebars/widgets for categories, but it doesn’t work of the english version of the categories. (Nothing appears at left for the english version of the categories)Here my code (in the sidebar.php) : `<?php
/**
* The Sidebar containing the main widget areas.
*
* @package sparkling
*/
?>
</div>
<div id=”secondary” class=”widget-area col-sm-12 col-md-4″ role=”complementary”>
<div class=”well”>
<?php do_action( ‘before_sidebar’ );
if ( is_category() ) {
$sidebar_id = ( is_category() ) ? sanitize_title( get_cat_name( get_query_var( ‘cat’ ) ) ) . ‘-sidebar’ : ‘sidebar’;
dynamic_sidebar( $sidebar_id );
}
elseif ( ! dynamic_sidebar( ‘sidebar-1’ ) ) { ?>
<aside id=”search” class=”widget widget_search”>
<?php get_search_form(); ?>
</aside>
<aside id=”archives” class=”widget”>
<h3 class=”widget-title”><?php _e( ‘Archives’, ‘sparkling’ ); ?></h3>
<ul>
<?php wp_get_archives( array( ‘type’ => ‘monthly’ ) ); ?>
</ul>
</aside>
<aside id=”meta” class=”widget”>
<h3 class=”widget-title”><?php _e( ‘Meta’, ‘sparkling’ ); ?></h3>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</aside>
<?php
}
?>
</div>
</div><!– #secondary –>
`Do you have an idea of what I’ve to do ?
Thank you very much.
- The topic ‘Special PHP code for category and the plugin’ is closed to new replies.