fosterTerence
Forum Replies Created
-
I’d welcome that improvement too.
Forum: Plugins
In reply to: [amr shortcode any widget] WP-Rocket and widgets for shortcodeI followed the code and in the file “amr-shortcode-any-widget.php” the function “amr_do_widget_area” calls the standard wordpress function dynamic_sidebar($widget_area); on line 77. When WP-Rocket plugin is deactivated it returns the full sidebar including <section> and <h2> tags. When WP-Rocket is activated it returns the sidebar without <section> and <h2> tags.
I added following code to my functions.php which checks for the “widgets_for_shortcodes” sidebar and adds those tags dynamically.
// Widget has <section> and <h2> removed somehow when WP-Rocket is active
// With this function we add them dynamically again
function widgets_for_shortcodes_widgets($params) {
// Check if we are dealing with the correct sidebar with id=”widgets_for_shortcodes”
if(isset($params[0][‘id’]) && $params[0][‘id’] == ‘widgets_for_shortcodes’){
// Get and edit parameters
$widget_id = $params[0][‘widget_id’];
$widget_number = ‘-‘.$params[1][‘number’];
$widget_class = rtrim($params[0][‘widget_id’],$widget_number);
// Only replace empty values generated by Wp-Rocket
if(empty($params[0][‘before_widget’])) {
// Since widgets have class with or without widget_xxxxx we add both
$params[0][‘before_widget’] = ‘<section id=”‘.$widget_id.'” class=”widget widget_’.$widget_class.’ ‘.$widget_class.’ “>’;
}
if(empty($params[0][‘after_widget’])) {
$params[0][‘after_widget’] = ‘</section>’;
}
if(empty($params[0][‘before_title’])) {
$params[0][‘before_title’] = ‘<h2 class=”widget-title”>’;
}
if(empty($params[0][‘after_title’])) {
$params[0][‘after_title’] = ‘</h2>’;
}
}
return $params;
}
add_filter(‘dynamic_sidebar_params’,’widgets_for_shortcodes_widgets’);Advise for Anmari: I tested styling the [do_widget] shortcode with wrap=section and title=h2 in the shortcode. And that works fine. The [do_widget_area] doesn’t apply these parameters. With the above function you could implement that functionality to the [do_widget_area] also?
I know it is probably not your plugin’ fault Wp-Rocket doesn’t work together with the widgets_for_shortcodes sidebar. Maybe this helps others. Keep up the good work.
Experience the issue again after long time. Has to do with changing the Visual Portfolio name and the length of the name.
After checking the DB and some testing it is caused by the post_type changing from ‘vp_lists’ to ‘post’ when saving a changed name from the Portfolio Layout list page via Quick Edit. After manualy changing them back in the DB the Portfolio Layouts are back. Not sure if it is a WordPress or Visual Portfolio issue…
Case closed
Hi Dimitris,
Found the cause of the issue. I thought with custom sidebar plugin I configured the sidebar to be visible on certain categories in the default language. Because of WPML I need to configure the category name for each language for Archive category. -> now the sidebar shows even when there is no post result.
Thanks anyway!
Hi Nastia, I have setup the custom sidebar for a 404 page, that works fine. There is also a standard content-none.php template-part which is shown when a category has no posts. This is the page I would like to assign a custom sidebar. There is no option under Widgets -> Appearance to assign it to this page.
Hi mendter,
I had the issue that on some pages it would detect a sidebar although it doesn’t have one (not on all pages just on some). After updating this didn’t happen anymore. Don’t know why. I think it is a global function which looks globally if there is a sidebar. I suspect the plugin kicks in after that and exchanges the sidebar with the indicated sidebar. This way the global check just stay in place.
Hi Oguz,
I thought the same. The “is_active_sidebar” function is global. But in general it is used on every page, so it works! I investigated our issue further and found out that it doesn’t happen anymore. I upgraded your plugin to the latest version this weekend. So lets close the issue.Forum: Plugins
In reply to: [Edit Flow] [Plugin: Edit Flow] I can't get the email notification to work.I don’t receive e-mails when I enabled the option “Always notify blog admin” and made sure the option “Page” in the “Post” are ticked ON in notification area.
The author of the posts receives the notification well (other user with one of my other e-mail addresses)
Who is informed as Admin?
1) All users with administrator rights?
2) The e-mail adres under Settings -> General?Thanks