Archived

This topic is now archived and is closed to further replies.

  • 0

Adding A Custom Sidebar


Question

Posted · Report post

Hi,

 

Please can someone tell me how to create additional sidebars... 

 

Regards,

Cait

Share this post


Link to post
Share on other sites

7 answers to this question

Posted · Report post

Hi Cait,

 

If you view the last post in the following topic, it has code attached that will create a custom sidebar called Blog.

 

http://www.pagelines.com/forum/topic/24707-hot-to-add-a-custom-sidebars/

 

1. Copy the code on the last topic to a text file and save the file with the following name section.php

2. Now create a folder called sb-blog

3. Add the section.php file to the sb-blog folder

4. Now you will need to use your favourite FTP client and connect to your site.

5. Then navigate to the following directory.

 

wp-content/themes/pagelines-template-theme/sections/

 

Note: If you have renamed, the child theme, then navigate there instead.

 

6. Once there, upload the folder sb-blog to the sections folder.

Once the upload has completed, go to Appearance > Widgets and there should be a sidebar called Blog, which you can add your widgets to.

 

Now navigate to PageLInes > Drag & Drop and click Wrap, SB1 or SB2 and drag and drop the Blog section into the Active Sections.

Share this post


Link to post
Share on other sites

Posted · Report post

Thank you, it worked.

 

Regards,

Cait

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Cait,

 

You have an error in your custom sidebars code, which can be seen below.

 

Class Name: BEESidebar

 

 

class BeeSidebar extends PageLinesSection {
 
The Class names are different, fix this and your custom sidebar should work. I have now marked this topic as resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

Now how would I add more than 1?

 

Regards,

Cait

Share this post


Link to post
Share on other sites

Posted · Report post

What you will need to do is copy the folder you have for your custom Sidebar and then do the following:

 

You need to change the folder name, so that it is different to other custom sidebars.

You will also need to change the following lines in the section.php file, change Blog Sidebar and BlogSidebar to something unique.

 

 

Section: Blog Sidebar
Class Name: BlogSidebar

 

And also change the value here

 

    pagelines_register_sidebar($setup, 99);

To something unique, I recommend you use a higher value rather than going lower for example, 110, 120, 130 etc...

Share this post


Link to post
Share on other sites

Posted · Report post

This is what is in the file

 

 

 

<?php
/*
Section: BEE Sidebar
Author: Danny
Author URI: http://www.pagelines.com
Description: The main widgetized sidebar.
Class Name: BEESidebar
Workswith: sidebar1, sidebar2, sidebar_wrap
Persistant: true
*/


class BeeSidebar extends PageLinesSection {
  /** PHP that always loads no matter if section is added or not. */
  function section_persistent() {
    $setup = pagelines_standard_sidebar($this->name, $this->settings['description']);
    pagelines_register_sidebar($setup, 98);
  }


  /** Section template. */
  function section_template() {
    pagelines_draw_sidebar($this->id, $this->name, '');
  }
}
 

It is not working... Can you tell me what's wrong with it?

 

Also where do I go to change the sidebar priority, maybe that's the problem?

Share this post


Link to post
Share on other sites

Posted · Report post

I have also tried ($setup, 110)

Share this post


Link to post
Share on other sites