Jump to content
Sign in to follow this  
netage

Adding A Custom Sidebar

Recommended Posts

netage    5
netage

Hi,

 

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

 

Regards,

Cait

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
netage    5
netage

Thank you, it worked.

 

Regards,

Cait

Share this post


Link to post
Share on other sites
netage    5
netage

Hi,

 

Now how would I add more than 1?

 

Regards,

Cait

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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...


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
netage    5
netage

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
Danny    1,327
Danny

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.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • Anthony CALCI
      By Anthony CALCI+
      Hello,
      I have switched from the Framwork theme to DMS theme on http://calcipatrimoine.theproofingcompany.fr (miror site of http://calci-patrimoine.com).
      But I have now only the Primary sidebar in the Widget section ! Secondary sidear, Footer sidebar have all disapear...
      Can I have help to have them back ?
      Regards,
      Anthony
    • colleenc
      By colleenc+
      I am having an issue with the size of the font in a text box widget on my sidebar. It has me completely baffled because I have two text widgets on my sidebar and the other one is displaying perfectly. 
      The sole difference between the two is the amount of text in the widget, but that can't be the problem.
      My site is: loveandnudes.com and the text widgets are on the right side at the top. 
      I have duplicated the one with the issue and I am fiddling with it right now to see if I can find a solution. But I would love any suggestions. I though CSS would do the trick, but either I tried the wrong thing - or I put it into the wrong place.
      Thanks for your help!
    • Queue-it
      By Queue-it+
      Hi,
      Is it possible to add a sidebar only for one post category? Without adding extra plugins or editing the theme code? 
      I have 4 categories of posts (blog post, news, job listing, case studies) but I want to have a sidebar only for the blog posts to appear. 
      How can I do that? 
      Thanks!
    • flourishdesignstudio
      By flourishdesignstudio
      I am working  on a PL5 site that uses a IDX feed plugin that includes templates for that individual plugin (ex - a property listings template, a single property template, etc.) However, when I edit the Pagelines Content area to also feature a sidebar it will not actually save or apply to any of the other property pages. Are there any know issues with the templates and hierarchy? It appears to be defaulting to read-width and I can't find any way to override this setting.
      Here is a link in case that is helpful to see: http://getreadyforwow.com/ihf/idx/mls-20649468-99_sunny_st_newport_beach_ca_92663
      Is there anything I can provide to you that may be helpful in solving this issue?
       
    • Digital805
      By Digital805
      Hello, Some differences between WHv3 and v6 is I can't figure out how to activate the sidebar widgets area. Also, I don't see previous entries at the bottom of my posts page that allows users to continue looking through posts. Can you help me with these?
      Thx.
×