Viewing 30 posts - 1 through 30 (of 30 total)
  • Author
    Posts
  • #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?

    #1157615

    Hey 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,
    Rikard

    #1157633

    Hi,

    Log in details shared in private content.

    Cheers,
    Ed

    #1158563

    hi guys, any update on this one please?

    #1158687

    Hi,

    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,
    Ismael

    #1158748

    Hey, 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.

    #1159042

    Hi,

    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,
    Ismael

    #1159344

    I 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.

    #1159751

    Hi,

    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,
    Ismael

    #1160044

    Thanks… 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,
    Ed

    #1160541

    Hi,

    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,
    Ismael

    #1171384

    Hi 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,
    Ed

    #1171673

    Hi,

    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,
    Ismael

    #1171760

    OK, 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?

    #1172049

    Hi,

    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,
    Ismael

    #1172299

    Hi,

    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,
    Ed

    #1172589

    Hi,
    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,
    Mike

    #1172598

    OK, 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/).

    #1172604

    By 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/

    #1172605

    Another 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.

    #1172607

    Thanks 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?

    #1172714

    Hi,
    Please take a look at your child theme functions.php your first line is:
    2020-01-13-043522
    it needs to be:
    2020-01-13-043633
    I tried to change it for you but WordPress says it needs to be done via FTP, please correct

    Best regards,
    Mike

    #1172723

    OK, 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.

    #1172801

    Hi,
    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,
    Mike

    #1172820

    Thanks 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);

    #1173048

    Hi,
    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,
    Mike

    #1173232

    Hi 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,
    Ed

    #1173345

    Hi,
    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,
    Mike

    #1173430

    Thanks 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 :)

    #1173890

    Hi,
    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

Viewing 30 posts - 1 through 30 (of 30 total)
  • You must be logged in to reply to this topic.