• On my WordPress website I use Menubar 5.6.4. I have 2 menus that I want to add to a page template to the right sidebar.

    With this code: <?php do_action(‘menubar’,’jeugdmenu’); ?> I can show the menu but the location is not what I want – it seems the menu is under the sidebar, see: /jeugd/. This page is a page template.

    How can I get it as e.g. this page /algemeenjeugd/

    • This topic was modified 5 years, 5 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello tvk5300,

    I see you’ve already solved the problem.

    For other interested readers, if you want to add a menu in the sidebar, it’s best to use a widget, the Menubar widget or the default Navigation Menu widget.

    Hello tvk5300,

    Is your sidebar a dynamic sidebar where you can add and remove widgets from the dashboard? Or is it a static hand coded sidebar, that you don’t modify from the dashboard?

    Hello Luc,

    The classic editor plugin will be maintained at least till December 31, 2021, see

    Classic Editor Plugin Support Window

    And the new block editor won’t see any difference between standard and custom page templates, and will treat them all the same.

    So I think you don’t have reasons to be concerned about the future of your site. In any case a new page template won’t make any difference with the new block editor, so you don’t need to bother.

    What do you think?

    Thread Starter tvk5300

    (@tvk5300)

    Andrea, the problem is that I use a lot of PHP code on my pages.
    I use the “phpexec.php” plugin now; this works in the classic editor, but for now on not in the Gutenberg editor.

    I am trying to switch my PHP to “Insert PHP Code Snippet”, but sometimes it works and sometimes I get errors; e.g. the page https://www.doskobeveren.be/kalperweekform/: select a week and the form submit this to the page https://www.doskobeveren.be/kalperweek/.
    There I use the submitted dates to pass them to a external page using this code to show the result:

    <phpcode>
    <?php
    if(empty($_POST[‘submit’])) {header(“location: /kalperweekform”);}
    $startdag = $_POST[‘KBVB_datumvan_dag’];
    $startmaand = $_POST[‘KBVB_datumvan_maand’];
    $startjaar = $_POST[‘KBVB_datumvan_jaar’];
    $date = new DateTime($startjaar.’-‘.$startmaand.’-‘.$startdag);
    $datum=$date->modify(‘+6 day’);

    $datum = date_format($date,”d-m-Y”);
    $arr = explode(‘-‘, $datum);
    $einddag = $arr[0];
    $eindmaand = $arr[1];
    $eindjaar = $arr[2];
    echo “Gekozen week van: ” .$startdag. “-” .$startmaand. “-” .$startjaar. ” tot: ” .$einddag. “-” .$eindmaand. “-” .$eindjaar. “<br>”;
    ?>
    </phpcode>

    To show the first iframe (because this is data of an external site and can only be reached by using an iframe) I use then:

    <iframe width=”560″ height=”1050″ id=”f1″ name=”f1″ src=”https://extranet.e-kickoff.com/kbvb_publiek/kalender.do?command=Bekijken&LANG=N&matricule=04334&useCssNewFootbel=hosted-pages&selectedSerPlus_id=PCC81316&wat=data&enkel=alle&KBVB_datumvan_dag=<phpcode&gt;
    <?php echo $startdag ?>
    </phpcode>&KBVB_datumvan_maand=<phpcode>
    <?php echo $startmaand ?>
    </phpcode>&KBVB_datumvan_jaar=<phpcode>
    <?php echo $startjaar ?>
    </phpcode>&KBVB_datumtot_dag=<phpcode>
    <?php echo $einddag ?>
    </phpcode>&KBVB_datumtot_maand=<phpcode>
    <?php echo $eindmaand ?>
    </phpcode>&KBVB_datumtot_jaar=<phpcode>
    <?php echo $eindjaar ?>
    </phpcode>” scrolling=”yes”></iframe>

    Using the classic editor this works but switching to the Gutenberg editor results in en error.

    I have tried to replace <phpcode><?php with [insert_php] and ?></phpcode> with [/insert_php] and I get errors.

    Therefore i had the idea to make an own template for the page to avoid the use of the extra tags <phpcode> and [insert_php]; but then my menubar “jeugdmenu” is not present as e.g. on the page https://www.doskobeveren.be/jeugd/.

    Perhaps I do not understand well how to make an template (I use the theme responsivepro-child) or I have to be patience until all plugins are upgraded?

    Thread Starter tvk5300

    (@tvk5300)

    For the page https://www.doskobeveren.be/kalperweek/ I found how to resolve the problem, Using [insert_php][/insert_php] I have to echo the full <iframe>.

    So with this code:
    [insert_php]
    echo “Gekozen week van: ” .$startdag. “-” .$startmaand. “-” .$startjaar. ” tot: ” .$einddag. “-” .$eindmaand. “-” .$eindjaar. “<br>”;
    echo ‘<iframe width=”560″ height=”1050″ id=”f1″ name=”f1″ src=”https://extranet.e-kickoff.com/kbvb_publiek/kalender.do?command=Bekijken&LANG=N&matricule=04334&useCssNewFootbel=hosted-pages&selectedSerPlus_id=PCC81316&wat=data&enkel=alle&KBVB_datumvan_dag=&#8217; .$startdag. ‘&KBVB_datumvan_maand=’ .$startmaand. ‘&KBVB_datumvan_jaar=’ .$startjaar.’&KBVB_datumtot_dag=’.$einddag.’&KBVB_datumtot_maand=’.$eindmaand.’&KBVB_datumtot_jaar=’.$eindjaar.'” scrolling=”yes”></iframe>’;
    [/insert_php]

    my page works also without the phpexec.php plugin.
    However the Gutenberg editor seems to have problems when you use functions in a page, because I still have to use the classic editor to make changes to the code; the error I get is:

    Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (–) at position 0 (-): Unexpected character in /customers/7/4/e/doskobeveren.be/httpd.www/wp-content/plugins/insert-php/insert_php.php(89) : eval()’d code:7 Stack trace: #0 /customers/7/4/e/doskobeveren.be/httpd.www/wp-content/plugins/insert-php/insert_php.php(89) : eval()’d code(7): DateTime->__construct(‘–‘) #1 /customers/7/4/e/doskobeveren.be/httpd.www/wp-content/plugins/insert-php/insert_php.php(89): eval() #2 /customers/7/4/e/doskobeveren.be/httpd.www/wp-includes/class-wp-hook.php(286): will_bontrager_insert_php(‘apply_filters(‘

    Soit is still waiting for an update of the plugin I suppose.

    Hello Luc,

    Sorry I’m not familiar with those plugins, but it seems that version 2.x.x of the plugin you are using:

    https://www.ads-software.com/plugins/insert-php/

    does work with the new block editor (Gutenberg), see:

    https://github.com/WordPress/gutenberg/issues/8444

    Probably you can try using version 2 snippets instead of [insert_php] … [/insert_php].

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress Menubar 5.6.4’ is closed to new replies.