-
AuthorPosts
-
November 16, 2019 at 10:45 pm #1157554
I’ve used Enfold for years – amazing theme, thank you! Today I tried for the first time to replace a default sidebar with widget content in the sidebar (using the “chose a customer sidebar for this entry” option)… however the widget content is displayed below the default sidebar content, rather than replacing it entirely How can I replace rather than add to a default sidebar?
November 17, 2019 at 12:55 pm #1157615Hey edgold,
If you select to use a different sidebar then the whole sidebar should be replaced with the new one. If that is still not working then please post admin login details in private so that we can have a closer look at your settings.
Best regards,
RikardNovember 17, 2019 at 1:49 pm #1157633Hi,
Log in details shared in private content.
Cheers,
EdNovember 20, 2019 at 6:28 pm #1158563hi guys, any update on this one please?
November 21, 2019 at 4:34 am #1158687Hi,
Sorry for the delay. The widget containing the “Shakespeare’s Top Characters” seems to be displaying at the top part of the sidebar just below the google ad widget. How did you add the ad widget?
Best regards,
IsmaelNovember 21, 2019 at 8:25 am #1158748Hey, I don’t seem to be able to share a screen grab here, but on https://www.nosweatshakespeare.com/characters/fortinbras-hamlet/ I’m seeing my “top characters” widget in the sidebar way down the page, below the default sidebar.
All ads widgets are added using the adthrive plug in.
November 22, 2019 at 9:56 am #1159042Hi,
Thank you for the update.
The “Displayed Everywhere” widget area is empty, so there’s actually no “default sidebar”. The “top characters” widget is located right at the very bottom of the first ad widget. Please check the screenshot below.
Screenshot: https://imgur.com/a/aGR9unB
Try to remove the browser cache or check the page on incognito mode.
Best regards,
IsmaelNovember 22, 2019 at 10:33 pm #1159344I don’t understand your point about there being no default side bar. RIght across my site the child pages are shown in the sidebar, without the use of the “displayed everywhere” widget – or any widgets at all. Now on this particular page I’m trying to replace this sidebar that is shown by default with one that is shown in a widget.
The screengrab that you show of the side bar below the ad unit is not showing the top characters widget. Please scroll down on this page and you’ll see the “top characters widget” is much further down in the sidebar (and has a title “Shakespeare’s Top Characters” at the top of it). I’d like to remove all of those sidebar links above this widget.
November 25, 2019 at 3:58 am #1159751Hi,
Thank you for the update.
I really thought that’s the “top characters” widget. Sorry about that. We disabled the Page Sidebar navigation option from the Enfold > Sidebar Settings panel. The default page navigation widget has been removed.
Best regards,
IsmaelNovember 25, 2019 at 9:33 pm #1160044Thanks… but this solution now gives all pages which have a sidebar enabled a sidebar containing all pages on the entire website, rather than just the child pages of the page the sidebar is on. In this scenario I’d need to either give every page on the website a custom sidebar, or turn off the sidebar individually for all pages (or a combination of the 2).
Is there any way – at a page level – to keep the page navigation sidebar for the site overall, but overwrite with customer sidebar for specific pages?
Thanks,
EdNovember 27, 2019 at 2:43 am #1160541Hi,
Thank you for the update.
Is there any way – at a page level – to keep the page navigation sidebar for the site overall, but overwrite with customer sidebar for specific pages?
You can use the following filter to disable the Page Sidebar Navigation on specific pages.
function avf_sidebar_menu_filter_mod($menu, $args, $post) { if(is_page(array(42, 'about', 'Contact')) { $menu= ''; } return $menu; } add_filter('avf_sidebar_menu_filter', 'avf_sidebar_menu_filter_mod', 10, 3);
Add the id, slug or title of the pages where you don’t want to show the page navigation into the array inside the is_page conditional function.
// https://developer.wordpress.org/reference/functions/is_page/
Please don’t forget to re-enable the Page Sidebar Navigation from the Enfold > Sidebar Settings.
Best regards,
IsmaelJanuary 8, 2020 at 11:15 am #1171384Hi Ismael,
Thanks for the response and the suggestion and apologies for the long delay. I’m now back and determined to crack this one ;)
For the code you’ve provided, where should I add it to get it working?
And a recap of the ask: I’d like all pages on my site to have a sidebar – the majority to keep the default sidebar which shows all child pages, and a handful of pages to show a sidebar that consists of a widget menu only. Does the code you’ve shared above allow me to do this?
Cheers,
EdJanuary 9, 2020 at 3:21 am #1171673Hi,
Thank you for following up.
You should add it in the child theme’s functions.php file. It will remove the default sidebar navigation in the specified pages.
Best regards,
IsmaelJanuary 9, 2020 at 11:42 am #1171760OK, I’ve tried creating a child functions.php file (copied and pasted from the main theme to the child theme), but then get this wordpress error: “There has been a critical error on your website. Learn more about debugging in WordPress.”
When I change the name of the functions.php file in the child theme or remove it the site is fine again, but the child functions file doesn’t work. I appreciate this thread is about something entirely different, but can you point me to any resources that might help me create a working child funcitons.php file?
January 10, 2020 at 4:12 am #1172049Hi,
Did you create a child theme? This documentation should help you how to properly activate a child theme when using Enfold.
// https://kriesi.at/documentation/enfold/child-theme/
And try to enable the debug mode so that we can see the actual error.
// https://wordpress.org/support/article/debugging-in-wordpress/#example-wp-config-php-for-debugging
Set the WP_DEBUG_DISPLAY to true and the display_errors from 0 to 1.
Best regards,
IsmaelJanuary 10, 2020 at 8:36 pm #1172299Hi,
Yes, I’ve been using a child theme for years, just with a style.css file in it.
I’ve enabled debug mode and amended the code, then added the funcitons.php file to my child theme, along with all the other files that the debug mode suggested I need. I’m now getting this website error message that I’m not sure how to resolve:
Fatal error: Cannot redeclare av_theme_slug_setup() (previously declared in /home/nosweats/public_html/wp-content/themes/enfold-nss-child/functions.php:536) in /home/nosweats/public_html/wp-content/themes/enfold/functions.php on line 536
There has been a critical error on your website.Any ideas?
Cheers,
EdJanuary 12, 2020 at 10:46 pm #1172589Hi,
Sorry for the late reply, I have reviewed the thread and I see that at one point you copied the parent theme functions.php and added it to your child theme, this caused your error because it contained functions that are now being called twice.
The functions.php for the child theme should be basically empty except for this code at the very top:<?php
and then your addon function below it.
If you download the pre-built child theme you will see what I mean.
I see that your child theme has almost all of the files from your parent theme in it, you should really only have the style.css, functions.php, and any file that you customized in your child theme.Best regards,
MikeJanuary 12, 2020 at 11:42 pm #1172598OK, thanks for the response. I’ve resolved the child theme issues, and the functions.php in the child theme is now working OK, although it seems to be causing an issue with the sticky header – on scroll there’s now a gap between the top of the header and the browser window.
I’ve added a page ID (162) as instructed to the code in the funcitons file, but the sidebar is still displaying on page 162 (https://www.nosweatshakespeare.com/resources/shakespeare-facts/).
January 13, 2020 at 12:42 am #1172604By the way – but i hope it will clarify it a bit: The sequence of the widget-areas is determined in sidebar.php
so if you like to have the display-everywhere widget area under a custom widget area
find this ://global sidebar if (dynamic_sidebar('Displayed Everywhere')) : $default_sidebar = false; endif;
and put it under the :
if($custom_sidebar) { dynamic_sidebar($custom_sidebar); $default_sidebar = false; }
put the edited file to your child-theme folder
but this will globally change the sequence – means every custom widget area will be over the display everywhere.
Don’t know if there was a child-theme influence of the sequence for specific pages only.https://kriesi.at/support/topic/sidebarwidget-issues-2/
see in action: https://webers-testseite.de/guenni/masonry/
January 13, 2020 at 12:52 am #1172605Another idea is to edit the register-widget-area.php file and use the filter: avf_show_default_sidebars
but this had to be shown by mods here – i had to go for now.January 13, 2020 at 12:56 am #1172607Thanks Guenni. What I’m trying to achieve doesn’t feel like it should be that hard. I want most pages to have the default sidebar (showing all child pages) and some pages to use a widget only for the sidebar (not a widget underneath the default sidebar content).
Is there a way to do this without all this code, which so far has taken me weeks of back and forth but got me nowhere?
January 13, 2020 at 11:38 am #1172714January 13, 2020 at 11:59 am #1172723OK, I’ve amended the code as suggested. The whole website is now showing this error message:
Parse error: syntax error, unexpected ‘;’ in /home/nosweats/public_html/wp-content/themes/enfold-nss-child/functions.php on line 5
There has been a critical error on your website.January 13, 2020 at 2:38 pm #1172801Hi,
I found that the function is missing a “)” which was causing the error, this is the updated code:function avf_sidebar_menu_filter_mod($menu, $args, $post) { if(is_page(array(42, 'about', 'Contact'))) { $menu= ''; } return $menu; } add_filter('avf_sidebar_menu_filter', 'avf_sidebar_menu_filter_mod', 10, 3);
but I don’t think this is working correctly, just to make sure I’m understanding this correctly, on the one page in the Private Content area you don’t want the sidebar menu to show, or is it that you don’t want the sidebar to show?
Best regards,
MikeJanuary 13, 2020 at 3:25 pm #1172820Thanks for the updated code Mike. The site now looks fine, but I don’t think it’s functioning as it should.
The page I gave you was just an example – I have a site section with so many child pages the default sidebar goes on for too long, so would like to use a variety of widgets rather than the default sidebar for these pages.
I’ve added page ID 162 to the code you provided, as per below, but this page is still displaying the default sidebar.
function avf_sidebar_menu_filter_mod($menu, $args, $post) {
if(is_page(array(42, 162, ‘about’, ‘Contact’))) {
$menu= ”;
}
return $menu;
}
add_filter(‘avf_sidebar_menu_filter’, ‘avf_sidebar_menu_filter_mod’, 10, 3);January 14, 2020 at 3:25 am #1173048Hi,
I have figured it out, step one is to go to Enfold Theme Options > Sidebar Settings > Page Sidebar navigation and uncheck the “Page Sidebar navigation” option, then go to your “Page Sidebar” widget and add a empty text widget, now nothing shows in your sidebar.
You can add a different widget to replace the empty text widget if you like, it is only a placeholder so the menu doesn’t show and any widget there will prevent the menu from showing. You can also change which sidebar shows on the page by choosing one of your many custom sidebars.I will also point out that you are using Enfold v3.8.5 with WordPress v5.3.2, this version of Enfold is not expected to be compatible with the version 5 of WordPress because of the major changes it included. Please update.
Unfortunately, due to the Theme Forest changes of replacing the API key with the “Token” you will have to update via FTP.
The easiest and safest way to do this is to download the newest version from Theme Forest and rename your current theme folder to “enfold-old” via ftp then upload the new “enfold” folder and check that your site is working correctly.
Should for some reason you wish to roll-back to the old version, it’s easy to do, simply rename the new “enfold” folder to “enfold-new” via ftp and then rename “enfold-old” to “enfold” then refresh your page.
Once you are happy you can delete the “enfold-old” folder via ftp, (not the WP theme page)
Please don’t try to overwrite the theme folder, as this will leave old files behind and cause errors.Best regards,
MikeJanuary 14, 2020 at 11:44 am #1173232Hi Mike,
Thanks for this – it gets me where I need to get to, though with lots of manual work, as I’ll need to create dozens/hundreds of custom menus and update all my 1,500 pages with the correct widget sidebar, when most of my existing pages are fine with the default sidebar. So one last follow up Q on this ;) Is there a way to use your suggestion for the pages I want a different sidebar for, but for other pages keep the default sidebar in place?
RE: Enfold update, thanks for this – hadn’t realized there was an update required. Will get on to it.
Cheers,
EdJanuary 14, 2020 at 2:46 pm #1173345Hi,
I’m not sure I follow how this will create lots of manual work, lets take a look at this. So are most of your pages going to have the same sidebar?
If true then set the “Page Sidebar” widget to reflect that, even if this means you want the sidebar menu on most of them, in which case you can remove the blank the empty text widget.
then if there are a few pages you want a different sidebar then in those pages change which sidebar shows on the page by choosing one of your other sidebars in the “layout” option of the page when you are editing it.
If the number of pages is closer to 50/50 or something more complex, then try the plugin Widget Options which will give you the option to show or hide each widget element on any number of pages, then you can add the “navigation menu” widget to your sidebar and choose the pages to show or hide on and then add your other widgets and do the same. This way all of the changes are made from the widget option page and you won’t need to edit any of the pages.
I hope one of these approaches helps you set your sidebar the easiest way for you.Best regards,
MikeJanuary 14, 2020 at 4:39 pm #1173430Thanks for the plug in tips.
The suggested solution will create manual work because for ~70% of my 1,500 pages the default sidebar is perfect, and I don’t want or need to change it. These 70% of pages will have maybe 30-50 variations in the content of the sidebar. The suggested solution will involve me manually creating these 30-50 existing sidebars as widgets, then working through the 1,000 pages to add the widgets to them, which if Enfold allowed me to chose between a default sidebar and a widget sidebar at a page level I wouldn’t need to do.
It’s not the end of the world, I’ll have a think about other potential workarounds. Enfold is still an excellent theme :)
January 15, 2020 at 10:50 am #1173890Hi,
Thanks, I understand better now, the plugin may work well for you because I’ve seen people have about ten different items in a sidebar which were checked off in different combinations to show on different pages or categories.
Is there anything else we can assist with on this issue or shall we close this thread?Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.