Tagged: enfold
-
AuthorPosts
-
October 24, 2013 at 3:03 pm #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 !October 25, 2013 at 6:42 am #180503Hey 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,
IsmaelOctober 25, 2013 at 3:18 pm #180704Hi,
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,
EvelineOctober 26, 2013 at 12:19 am #180860Hi!
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!
IsmaelOctober 28, 2013 at 5:36 pm #181678This reply has been marked as private.October 30, 2013 at 7:54 am #182345Hi!
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 -
AuthorPosts
- The topic ‘Different layout for portfolio tag archive and blog archive’ is closed to new replies.