- This topic has 16 replies, 2 voices, and was last updated 5 years, 6 months ago by
Tom.
-
AuthorPosts
-
June 23, 2016 at 4:02 pm #204159
Daniele
Here I come again π
Is there any chance to see implemented a hook before both sidebars?
like this:
June 23, 2016 at 11:48 pm #204214Tom
Lead DeveloperLead DeveloperCurrently this isn’t possible without some pretty decent custom programming.
I’ll play around with it tomorrow morning and will see if I can come up with a solution for you π
June 24, 2016 at 2:13 am #204252Daniele
Thank you Tom!
June 24, 2016 at 11:27 am #204337Tom
Lead DeveloperLead DeveloperAlright, I believe I have a solution for you π
First, you would add this function:
add_action( 'generate_sidebars','generate_double_right_sidebar', 0 ); function generate_double_right_sidebar() { ?> <div class="widget-area grid-50 tablet-grid-50 grid-parent sidebar double-sidebar"> <div class="inside-double-sidebar"> Hi there </div> </div> <?php }
grid-50 is assuming both of your sidebars are set to 25% – 25 x 2 = 50. If your sidebars are set to something else, you’ll need to adjust this.
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Then you’ll need to add this CSS:
.inside-double-sidebar { margin-top:20px; /* Separating space value */ background: #FFF; /* Widget background color value */ padding: 40px; /* Inside width padding value */ }
Adding CSS: https://generatepress.com/knowledgebase/adding-css/
That should do it π
June 25, 2016 at 8:51 am #204492Daniele
mmmm…that code seems working, creating a widget-like area but…how shall I put a widget in it? There’s no trace in the admin widget section of a “double sidebar”.. how-to?
I need that box just to show the youtube playlist channel widget (not it’s the first on top of the right column).
thanks again
June 25, 2016 at 10:04 am #204508Tom
Lead DeveloperLead DeveloperThis might help: http://codex.wordpress.org/Widgetizing_Themes
June 25, 2016 at 12:23 pm #204559Daniele
It might, but seems to be too complicated for a newbie like me.
Don’t worry, I know I’ve asked more than “support”.
Should I mark this topic as resolved?
June 25, 2016 at 11:56 pm #204619Tom
Lead DeveloperLead DeveloperThis part is how you create a widget area which will show up in “Appearance > Widgets”:
function alphabet_widgets_init() { register_sidebar( array( 'name' => 'Home right sidebar', 'id' => 'home_right_1', 'before_widget' => '<aside id="%1$s" class="widget inner-padding %2$s">', 'after_widget' => '</aside>', 'before_title' => apply_filters( 'generate_start_widget_title', '<h4 class="widget-title">' ), 'after_title' => apply_filters( 'generate_start_widget_title', '<h4 class="widget-title">' ), ) ); } add_action( 'widgets_init', 'alphabet_widgets_init' );
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Then your code from above would look something like this:
add_action( 'generate_sidebars','generate_double_right_sidebar', 0 ); function generate_double_right_sidebar() { ?> <div class="widget-area grid-50 tablet-grid-50 grid-parent sidebar double-sidebar"> <div class="inside-double-sidebar"> <?php if ( is_active_sidebar( 'home_right_1' ) ) : ?> <?php dynamic_sidebar( 'home_right_1' ); ?> <?php endif; ?> </div> </div> <?php }
Hope that helps out a bit π
June 26, 2016 at 7:12 pm #204767Daniele
Hi Tom,
thank you very much again.It works (as you can see) but it shows in every page and It was supposed to be just in the homepage. I added these lines to your code:
add_action( 'generate_sidebars','generate_double_right_sidebar', 0 ); function generate_double_right_sidebar() { ?> <div class="widget-area grid-35 tablet-grid-35 grid-parent sidebar double-sidebar"> <div class="inside-double-sidebar"> <?php if ( is_active_sidebar( 'home_right_1' ) ) : ?> <?php dynamic_sidebar( 'home_right_1' ); ?> <strong><?php if ( is_front_page() ) { ?></strong> <?php endif; ?> </div> </div> <?php
but it doesn’t work.
Then, I noticed that clicking on the ‘Read more button’ (+Altro), last posts shown are weird (actually, without box).
Thanks again,
d.June 26, 2016 at 11:54 pm #204786Tom
Lead DeveloperLead DeveloperIf it needs to only be on the homepage, you can do this:
add_action( 'generate_sidebars','generate_double_right_sidebar', 0 ); function generate_double_right_sidebar() { if ( ! is_front_page() ) return; ?> <div class="widget-area grid-50 tablet-grid-50 grid-parent sidebar double-sidebar"> <div class="inside-double-sidebar"> <?php if ( is_active_sidebar( 'home_right_1' ) ) : ?> <?php dynamic_sidebar( 'home_right_1' ); ?> <?php endif; ?> </div> </div> <?php }
June 27, 2016 at 6:49 pm #204993Daniele
Fantastic! π
Now my 80’s site is ready for your showcase page!
You made an incredible job. Why don’t you implement the same function in the next upgrade? Don’t you think it is really useful?
Thank you, really.
p.s. did you take a look of the other issue I got?
Then, I noticed that clicking on the βRead more buttonβ (+Altro), last posts shown (everywhere, home, pages, archives) are weird (actually, without box).
Is it maybe a known issue you are fixing?
thanks again Tom.
June 27, 2016 at 8:37 pm #205001Tom
Lead DeveloperLead DeveloperVery strange, the more button loads the posts from the next page, but those posts with no box aren’t on the next page of posts: http://www.80s.it/page/2
Maybe you have a plugin causing the issue?
June 28, 2016 at 7:37 pm #205254Daniele
infact…it’s the extended feature post plugin that mess up the: it creates a copy of each EFP widget after the content… π
June 29, 2016 at 12:02 am #205280Tom
Lead DeveloperLead DeveloperPerhaps that something they can fix?
If it’s something they think needs to be fixed on our end just let me know and I’ll look into it π
June 29, 2016 at 9:32 am #205383Daniele
No way…that plugin is out of date by 2 years now…but I’ve found a good replecement: Category Posts Widget
Have a nice day,
D. -
AuthorPosts
- You must be logged in to reply to this topic.