Home › Forums › WordPress Themes – Premium › Celestial (Celestial Reloaded) › Home Page Image Box Widgets
- This topic has 8 replies, 22 voices, and was last updated 9 years, 2 months ago by
Sushil Adhikari.
-
AuthorPosts
-
June 16, 2014 at 4:48 pm #15258
Greg Smith
ParticipantHi
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, GregJune 16, 2014 at 8:55 pm #20108Sushil Adhikari
ModeratorThat 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:
1. sidebar-top.php
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.
June 17, 2014 at 5:27 pm #20111Greg Smith
ParticipantThanks for explaining. I’ve added a second row of 4 images with text.
Help appreciated. Great service, GregJune 17, 2014 at 7:17 pm #20113Sushil Adhikari
ModeratorAh… good job. Before you know it, you will be making themes 🙂
June 17, 2014 at 7:18 pm #20114Greg Smith
ParticipantI don’t think I will – you haven’t seen my latest question……………………
Many thanks for your great service. GregJuly 11, 2014 at 3:31 pm #20249Greg Smith
ParticipantHi
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. GregJuly 11, 2014 at 8:21 pm #20250Sushil Adhikari
ModeratorStill 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.
July 11, 2014 at 8:38 pm #20251Greg Smith
ParticipantMany thanks…I’ll be careful, although I may have found a way round the effect without creating extra widgets.
Appreciate your help. Superb service. GregJuly 11, 2014 at 9:04 pm #15259Sushil Adhikari
ModeratorNo worries… if whatever you do and find a way, perhaps post it here for anyone else who might be considering doing a similar thing. Cheers!
-
AuthorPosts
- You must be logged in to reply to this topic.