Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #180247

    Hi,
    This is a really great theme !

    Is there a way to have different layouts for the Tag archive page (from portfolio) and the blog archive page ? I would like to have 2 different sidebars on each of them.
    Thanks !

    #180503

    Hey EvelineB!

    You can edit archive.php and tag.php, find this code:

    //get the sidebar
    				$avia_config['currently_viewing'] = 'blog';
    				get_sidebar();

    Replace it with this for archive page:

    //get the sidebar
    				$avia_config['currently_viewing'] = 'archive';
    				get_sidebar();

    And replace it with this code for tag archive page:

    //get the sidebar
    				$avia_config['currently_viewing'] = 'tag';
    				get_sidebar();

    Edit sidebar.php, find this code:

    // forum pages sidebars
                if ($avia_config['currently_viewing'] == 'forum' && dynamic_sidebar('Forum') ) : $default_sidebar = false; endif;

    Below, add this:

    // archive pages sidebars
                if ($avia_config['currently_viewing'] == 'archive' && dynamic_sidebar('Archive Pages') ) : $default_sidebar = false; endif;
    			
    			// tag pages sidebars
                if ($avia_config['currently_viewing'] == 'tag' && dynamic_sidebar('Tag Pages') ) : $default_sidebar = false; endif;

    Edit includes > admin > register-widget-area.php, find this code:

    foreach ($sidebars_to_show as $sidebar)
    		{
    			register_sidebar(array(
    				'name' => 'Single Product Pages',
    				'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">', 
    			'after_widget' => '<span class="seperator extralight-border"></span></div>', 
    			'before_title' => '<h3 class="widgettitle">', 
    			'after_title' => '</h3>', 
    			));
    		}

    Below, register the Tag and Archive widget area.

    
    		foreach ($sidebars_to_show as $sidebar)
    		{
    			register_sidebar(array(
    				'name' => 'Archive Pages',
    				'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">', 
    			'after_widget' => '<span class="seperator extralight-border"></span></div>', 
    			'before_title' => '<h3 class="widgettitle">', 
    			'after_title' => '</h3>', 
    			));
    		}
    		
    		foreach ($sidebars_to_show as $sidebar)
    		{
    			register_sidebar(array(
    				'name' => 'Tag Pages',
    				'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">', 
    			'after_widget' => '<span class="seperator extralight-border"></span></div>', 
    			'before_title' => '<h3 class="widgettitle">', 
    			'after_title' => '</h3>', 
    			));
    		}

    You can now add different widgets for Tag and Archive page.

    Regards,
    Ismael

    #180704

    Hi,
    Thanks for your reply.
    I edited the files as mentioned but I don’t see where to define my widgets. I thought I would have 2 new sections in the Appearance – Widgets menu ?.

    Is there something I need to do to “refresh” my admin ?

    Thanks,
    Eveline

    #180860

    Hi!

    Did you add this bit of code on includes > admin > register-widget-area.php?

    foreach ($sidebars_to_show as $sidebar)
    		{
    			register_sidebar(array(
    				'name' => 'Archive Pages',
    				'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">', 
    			'after_widget' => '<span class="seperator extralight-border"></span></div>', 
    			'before_title' => '<h3 class="widgettitle">', 
    			'after_title' => '</h3>', 
    			));
    		}
    		
    		foreach ($sidebars_to_show as $sidebar)
    		{
    			register_sidebar(array(
    				'name' => 'Tag Pages',
    				'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">', 
    			'after_widget' => '<span class="seperator extralight-border"></span></div>', 
    			'before_title' => '<h3 class="widgettitle">', 
    			'after_title' => '</h3>', 
    			));
    		}

    You should have the Tag Pages and Archive Pages widget area.

    Cheers!
    Ismael

    #181678
    This reply has been marked as private.
    #182345

    Hi!

    Personally I recommend to use this plugin: http://wordpress.org/plugins/widget-logic/ – it helps you to show/hide widgets on certain pages.

    If you want to show a widget just on the tag pages use following conditional

    
    is_tag()
    

    If you want to hide a wigdet on tag pages use

    
    !is_tag()
    

    Cheers!
    Peter

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Different layout for portfolio tag archive and blog archive’ is closed to new replies.