Archived

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

  • 0

Hot to Add a Custom Sidebars


Question

13 answers to this question

Posted · Report post

I followed the instructions and have a new sidebar on my test site.

 

I created a sidebar called Blog, I have pasted the code I used below, you can use this to see what went wrong with yours.

 

http://paste.pagelines.com/9zo

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

I'm using pro version 2.4.

I also can't find the sidebar priority option mentioned. It's not there. Maybe it used to be there in earlier versions ?

I also followed the custom sidebars guide in the wiki quoted above, but I created the new folder in /plugins/pagelines-sections/ instead of /themes/pagelines/sections and I used the whole code provided in the wiki for sections.php:

 

 

class MyCustomSidebar 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, 100);
}

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

 

 

This worked for me.

It might be because of the part "pagelines_register_sidebar" etc. which for some reason unknown to me is missing in the current core pagelines sidebar section.php files.

 

Hope this helps ;-)

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for your help Newbie,

I tryed to follow your instruction but it doesn't work for me!

I empty the browser cache and re-open Dashboard>Appearance>Widget but i don't find any new sidebar.

 

Have I to do anything else?

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

Buongiorno Michel,

 

I'm unsure why you do not see the Enable Priorities option.  Could you tell me which version of PageLines Framework you are using?  You can find out at Dashboard  Appearance > Themes

 

Enabling priorities though will only sort the order of widgets in the sidebars, making sure they do not become disorganized.  If they do, the solution is simply to move them up or down between sidebars to place them back where they belong.  So, the priorities are not critical or have anything to do with creating the custom sidebar.

 

Beyond the issue of enabling the priorities, did you implement anything else in the instructions for creating custom sidebars?

Share this post


Link to post
Share on other sites

Posted · Report post

ps. I have a Pro license!

Share this post


Link to post
Share on other sites

Posted · Report post

Buona notte,

 

The custom section, if you followed the instructions carefully here: http://www.pagelines.com/wiki/How_to_Add_Custom_Sidebars may not appear in Dashboard > Appearance > Widgets if you did not place it into a template.  WordPress doesn't know it exists.

 

How did you edit/create the section?  Could you provide us a step-by-step list of what you did?

 

Mille grazie!

Share this post


Link to post
Share on other sites

Posted · Report post

Ciao Rob, :)

my pagelines framework version is 2.3.8.

 

I just followed the Custom Sidebars guide.... http://www.pagelines.com/wiki/How_to_Add_Custom_Sidebars

So:

- I created a new folder via FTP in public_html/wp-content/themes/pagelines/sections and I renamed It sb_custom

- I created a section.php file and I put it into the new folder

- I copied a icon.png file from another sidebar

 

this is the php file content:

 

class MyCustomSidebar extends PageLinesSection {
   function section_template() {
         pagelines_draw_sidebar($this->id, $this->name, '');
    }
}

Share this post


Link to post
Share on other sites

Posted · Report post

smv_usdam said it to me on 28 January and I tryed it but it didn't work.

 

can you confirm that the only steps to do are these that I described on this post?

 

This is what i have done:
- I created a new folder called sb_custom in wp-content/themes/pagelines/sections
- I copied a icon.png file from another sidebar and I inserted it into the folder
- I inserted into this folder a section.php file

 

this is the php file content:

 

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

/**
 * Custom Sidebar Section
 *
 * @package PageLines Framework
 * @author PageLines
*/
class CustomSidebar extends PageLinesSection {

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

}

 

This is exatcly what I have done!

 

the custom sidebar should appear on Appearance>Widget on the right sidebar list?

Share this post


Link to post
Share on other sites

Posted · Report post

This is what i have done:
- I created a new folder called sb_custom in wp-content/themes/pagelines/sections
- I copied a icon.png file from another sidebar and I inserted it into the folder
- I inserted into this folder a section.php file

 

this is the php file content:

 

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

/**
 * Custom Sidebar Section
 *
 * @package PageLines Framework
 * @author PageLines
*/
class CustomSidebar extends PageLinesSection {

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

}

 

This is exatcly what I have done!

Share this post


Link to post
Share on other sites

Posted · Report post

Do you need further assistance with sidebars?

Share this post


Link to post
Share on other sites

Posted · Report post

I haven't tested this personally but I think you may have uploaded the section to the wrong location,

 

instead of:

 

wp-content/themes/pagelines/sections/

 

upload it here;

 

wp-content/plugins/pagelines-sections/

 

and see if that resolves your issue.

Share this post


Link to post
Share on other sites

Posted · Report post

yes please!!

on my latest post I described what I have done, but it doesn't work!

Share this post


Link to post
Share on other sites