Show sidebar on archives category page
-
Hi.. thanks for the great Everal Themes. Thats one of beautiful and clean themes .
I tested Everal themes on localhost, and there is no sidebar on archives page. Can you help me how to show sidebar on archieve page?Thanks for your attention.
-
Hello hansyulianto –
Hope you are having good time!May i have your site url please??
Hi, Vipin Saini..
I testing Everal on localhost. But later i will install at http://www.suyonos.com.On demo site, there is no sidebar on archieve page. http://cohhe.com/demo/everal/category/llis-ullam/
I think if it’s show sidebar (archieve page) on my site later, it will be great 🙂
Hello hansyulianto,
Can you please send me your archive.php and single.php file code?
Waiting for your words?single.php
<?php /** * The Template for displaying all single posts * * @package WordPress * @subpackage Everal * @since Everal 1.0 */ get_header(); global $site_width; ?> <div id="main-content" class="main-content row"> <div id="primary" class="content-area"> <div id="content" class="site-content <?php echo $site_width; ?>" role="main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); // Previous/next post navigation. everal_post_nav(); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } endwhile; ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar( 'content' ); ?> </div><!-- #main-content --> <?php get_sidebar(); get_footer();
archieve.php
<?php /** * The template for displaying Archive pages * * Used to display archive-type pages if nothing more specific matches a query. * For example, puts together date-based pages if no date.php file exists. * * If you'd like to further customize these archive views, you may create a * new template file for each specific one. For example, Everal 1.0 * already has tag.php for Tag archives, category.php for Category archives, * and author.php for Author archives. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Everal * @since Everal 1.0 */ get_header(); global $site_width; ?> <div id="main-content" class="main-content row"> <?php get_sidebar(); ?> <section id="primary" class="content-area <?php echo $site_width; ?>"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="page-header"> <h1 class="page-title"> <?php if ( is_day() ) : printf( __( 'Daily Archives: %s', 'everal' ), get_the_date() ); elseif ( is_month() ) : printf( __( 'Monthly Archives: %s', 'everal' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'everal' ) ) ); elseif ( is_year() ) : printf( __( 'Yearly Archives: %s', 'everal' ), get_the_date( _x( 'Y', 'yearly archives date format', 'everal' ) ) ); else : _e( 'Archives', 'everal' ); endif; ?> </h1> </header><!-- .page-header --> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. everal_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar( 'content' ); ?> </div><!-- #main-content --> <?php get_footer();
category.php
<?php /** * The template for displaying Category pages * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Everal * @since Everal 1.0 */ get_header(); global $site_width; ?> <section id="primary" class="content-area <?php echo $site_width; ?>"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : ?> <header class="archive-header"> <h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'everal' ), single_cat_title( '', false ) ); ?></h1> </header><!-- .archive-header --> <?php // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next page navigation. everal_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </section><!-- #primary --> <?php get_sidebar( 'content' ); get_sidebar(); get_footer();
Hello hansyulianto,
Thanks for patience!Please try to use the following code for your archive.php file.
<?php
/**
* The template for displaying Archive pages
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* If you’d like to further customize these archive views, you may create a
* new template file for each specific one. For example, Everal 1.0
* already has tag.php for Tag archives, category.php for Category archives,
* and author.php for Author archives.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Everal
* @since Everal 1.0
*/get_header();
global $site_width;
?>
<div id=”main-content” class=”main-content row”>
<?php
get_sidebar();
?>
<section id=”primary” class=”content-area <?php echo $site_width; ?>”>
<div id=”content” class=”site-content” role=”main”><?php if ( have_posts() ) : ?>
<header class=”page-header”>
<h1 class=”page-title”>
<?php
if ( is_day() ) :
printf( __( ‘Daily Archives: %s’, ‘everal’ ), get_the_date() );elseif ( is_month() ) :
printf( __( ‘Monthly Archives: %s’, ‘everal’ ), get_the_date( _x( ‘F Y’, ‘monthly archives date format’, ‘everal’ ) ) );elseif ( is_year() ) :
printf( __( ‘Yearly Archives: %s’, ‘everal’ ), get_the_date( _x( ‘Y’, ‘yearly archives date format’, ‘everal’ ) ) );else :
_e( ‘Archives’, ‘everal’ );endif;
?>
</h1>
</header><!– .page-header –><?php
// Start the Loop.
while ( have_posts() ) : the_post();/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( ‘content’, get_post_format() );endwhile;
// Previous/next page navigation.
everal_paging_nav();else :
// If no content, include the “No posts found” template.
get_template_part( ‘content’, ‘none’ );endif;
?>
</div><!– #content –>
<?php get_sidebar( ‘content’ ); ?>
</section><!– #primary –>
</div><!– #main-content –><?php
get_footer();I hope it will resolve your issue.
Feel free to ask further queries.
Cheers!It did’t work 🙁
Hi there,
on /Library/WebServer/Documents/wordpress/wp-content/themes/Everal/header.php line 54 please replace
$layout_type = 'full';
with$layout_type = 'right';
Best,
Cohhe$layout_type = 'right';
it’s working. Thanks a lot 😀
- The topic ‘Show sidebar on archives category page’ is closed to new replies.