I would like to add to the 4 image box widgets (Top 1 – 4) on the home page. I’ve added code to the widgets.php in the includes folder so that I get Top 5, Top 6, Top 7 and Top 8 in the admin widgets area. However even when I add text to these it doesn’t show on the “live” home page (http://www.dnaclient.co.uk/soundsorba/ ). How do I get the Top 5 to 8 widgets to show?
Help appreciated. Many thanks, Greg
That is very adventurous Greg, to add more widget positions to that area. I really cannot give a tutorial on how this is done as this falls well within customization which theme support does not cover. However, what I can do is list out the files you need to open and explore how the theme’s widgets are coded because this is done from couple file locations:
2. widgets.php ….there are two parts in this file, the register_sidebar and further below, function topgroup()
You also need to know how the span classes work for your widget columns. In the widgets.php file you will see the 4 widget code with span12, span6, span4, and span3. The problem here is that you have to keep the number of widget positions (columns) as even numbers keeping in mind you have up to 12 grid columns (the layout of the theme). If you have 7 widget positions with published widgets, this won’t work because 7 does not go into 12 evenly, nor does 5 widgets.
Now for the bad news…..In a sense, what you want to do is not really going to be possible because of how the theme (using the Bootstrap framework) is built on a 12-grid column layout. This means that if you want up to 8 widget positions side-by-side, for example the Top widget group, you cannot have 5 or 7 widgets published because they do not equally divide into 12. Only 1, 2, 3, 4, and 6 can evenly go into 12. Each widget published per group takes on a width that is equal to each other.
Your only option would be to use a page builder plugin that lets you create varying sidebar widths with a drag and drop method. So each page you make, you can create different numbers of widgets in a group side by side.
You advised when I increased the “Top” widgets from 4 to 8 which I achieved on http://www.dnaclient.co.uk/soundsorba/ . I’ve now tried the same method to increase to 12 “Top” widgets updating both “sidebar-top.php” and “widgets.php” but cannot get them to appear in the Admin widget section. Have I missed something?
Help appreciated. Greg
Still very risky with all this if you are not familiar with this type of coding, but if you still plan on going ahead with adding more widgets, .you need to look at how I did the widgets.php coding for widgets in the theme. The file is found in the /includes/ folder. Pay attention to how it was done for the theme’s current widget positions, but also check further down the file (// Lets do the top group) to see more code relating to grouped widget positions, such as the Top Group, top1, top 2, etc.
I’m not sure how this would work in a child theme as any modification to theme files should be done in one, but if you are doing this to the actual theme file(s), you won’t be able to update the theme without losing your custom changes, so please be aware of that.