- This topic has 9 replies, 4 voices, and was last updated 6 years, 10 months ago by Tom.
-
AuthorPosts
-
May 27, 2017 at 2:21 am #324794Benjamin
Hey Tom,
I often need to add a widgetized are to a GP Hooks.
Right now I’m doing it manually, i.e. I need to :
1) Add a code snippet like that using the code snippets plugin:
function gpwidg_generatepress_widgets_init_below_title() { register_sidebar( array( 'name' => 'GP Below Post Title', 'id' => 'below_post_title_gp1', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2 class="wiget-title">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'gpwidg_generatepress_widgets_init_below_title' );
2) Call the created sidebar in the GP hook like that :
<?php if ( is_active_sidebar( 'below_post_title_gp1' ) ) : ?> <div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary"> <?php dynamic_sidebar( 'below_post_title_gp1' ); ?> </div><!-- #primary-sidebar --> <?php endif; ?>
It’s slightly overkill.
Could you please just add a checkbox to GP Hooks which would do just the same ?
Here is how I see it :
https://screencast.com/t/gQw6Aj6Yr
This would make a GREAT addition to the premium version.
It should be quite easy to do too.
Let me know if the request is unclear.
Cheers,
PS: I suspect you didn’t widgetize all hooks from the start for better performance, right ?
May 27, 2017 at 8:00 am #324854SandeeThere’s a great plugin that does this easily — GeneratePress Extender by CobaltApps. I don’t have this particular plugin, but I have a few of their other products, and they are very well coded and easy to use. There’s a PHP builder that makes coding new widget areas quick and painless, so you should check it out.
https://cobaltapps.com/downloads/gp-extender-plugin/
Not a salesperson for them, but the developer, Eric Hamm, is a great guy. A lot like Tom, honest and hardworking, and I feel good recommending his stuff!
May 27, 2017 at 8:23 am #324866BenjaminThanks Sandee, yeah I know Eric and Cobalt and I’ve been a long time user of Catalyst & Genesis DWB.
I just refuse to add a plugin just for such a simple function.
GP already covers 99% of all my needs, I’m not gonna add a plugin just to add that 1% if the lead developer of GP understand my need and how it would help its users.
Cheers,
May 27, 2017 at 9:29 am #324892LeoStaffCustomer SupportWidget shortcode is a good option:
https://en-ca.wordpress.org/plugins/widget-shortcode/Using a well coded plugin won’t slow down your site. If we add everyone’s requests to GP then it will become bloated and slow. Code is code so it’s either in the theme or it’s in the plugin.
May 27, 2017 at 9:56 am #324898BenjaminIf we add everyone’s requests to GP then it will become bloated and slow.
Well if you had read my request you would probably have seen that it did make lot of sense and that it’s likely to be a feature a tons of users will need.
Also it won’t add any overhead since only the needed widgetized area will be created.
Now if you don’t want to make any improvement to that product, it’s up to you…
Hopefully Tom will have a look and it won’t just get completely ignored as your answer highly suggest it’ll be.
May 27, 2017 at 10:09 am #324903LeoStaffCustomer SupportWe haven’t had tons of requests on this. And the people that did are satisfied with the Widget Shortcode plugin solution.
Don’t need to be that aggressive. I’m not trying to ignore your suggestion – We are always looking to improve the products and welcome the suggestions.
All I’m saying is that there is a really good solution out there that a lot of people are using already 🙂
He will look at the post for sure.
May 27, 2017 at 10:21 am #324911BenjaminYeah sorry if I was a bit harsh, your answer looked a bit like “this look like a crappy request that I’m going to ignore just because plugin XYZ could more or less do the trick”.
The Widget Shortcode plugin that is almost always pushed when someone post a request similar to mine (I found similar requests many times) is far from satisfactory… you end up with all your widget in an “Arbitrary” placeholder on the widget configuration page, good luck finding out what widget content goes in what hook using that.
On the other side, it should be pretty easy to add that in a clean and easy fashion inside GP.
May 27, 2017 at 11:06 am #324929TomLead DeveloperLead DeveloperI’m not sure I understand.
So, if someone were to check that checkbox, it would turn that hook into a widget area in “Appearance > Widgets”?
May 27, 2017 at 11:28 pm #325051Benjamin@Tom yes exactly! If you see my code above it just creates a widgetized area inside the hook.
Sometimes using just the Hook is enough and probably better for performance. (I’m tempted to believe that you didn’t turn all hooks into widgets for performance reasons).
Sometimes, if you plan to use lots of logic inside your hook content, you will be very tempted to turn that hook content into a widgetized area and use a plugin such as Widget Logic instead of writing tons of line of PHP conditions that aren’t easily maintainable.
May 28, 2017 at 12:11 am #325061TomLead DeveloperLead DeveloperHuh, interesting concept. Thanks for this, I’ll definitely consider it 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.