Mainnav-mobi

Hi there!

I need to know which css statement is responsible for switching mainnav into mainnnav-mobi. Mainnav-mobi doesn’t work at my homepage.

Thank you very much indeed!

Beate

Hello Beate,

Mobile navigation css class is controlled with java script function from theme folder / js / main.js, in fact minified filed is in use main.min.js. If mobile menu is not working there is probably some js conflict, so please try to disable all your additional plugins, and test this again.

If you continue to have problems with this, please share your page link with us so we can inspect this further.

All the Best!

Hello Dimik,

to disable all plugins was the first I tried. Didn’t work neither. But I try it again and get in touch here again. Thank you for answering in the meantime.

Beate

Hello Dimik,

well, I tried and this is the result:

  1. Your co-worker Kharis once recommended to install plugin “header and footer scripts” in order to insert the following because of problems with anchors that didn’t lead to the right position coming from sub pages to main page. This plugin causes the mainnav-mobi problems. But the misleaded anchors worked very well after using this plugin. If I deactivate the plugin the anchor problems arise again. Dilemma. Any idea?

Thank you very much in advance! Beate (www.threeco.de)

<script>

;(function($) {

$(window).load(function () {

var currentElem = $('#' + window.location.hash.replace('#', ''));

if(currentElem) {
    $('html,body').animate({
      scrollTop: currentElem.offset().top
    }, 1000);
}

});

})(jQuery);
</script>

hello
i have been using sydney theme for over 5 months now and all of a sudden, for about four days now, the slider images and the menu are not showing up on the homepage.Please i need help. Thank you
http://www.geeksglobalworld.com

Hey Jones: And why did you put your question under may headline regarding mainnav-mobi? Please state your own question in the sydney forum. Thank you very much. Beate

@Jones

Hello there,

Please open new topic regarding your question since it is not related to Beate Hensel question.

@Beate Hensel

Hello again,

You can keep that plugin disabled, and you don’t have to use provided code. Issue with scrolling to anchor is present because function have hard coded value for header height, and this value can vary slightly.

Open theme folder / js / main.js file find following code, and replace marked value http://screencast.com/t/5knkLdzhKq9M with 79, because header size on your page after scroll is 79px. After that use some minifying tool like this one http://jscompress.com/ to minify this file, and save minified file over main.min.js file inside same folder (because this file is loaded with the theme).

After this scroll to function should scroll to exact location.

Let us know how this turned out.
All the Best!

Hello Dimik,

no, doesn’t work. The same problem as it was when Kharis recommended the plugin. Without the plugin I have got the same problem. Look for yourself:

Coming from sub page and choose “3Co. Portfolio” in navigation I do not end up at “3Co. Portfolio” but at “Home”.

Coming from sub page and choose “Kontakt” (pg 220-10) in navigation I end up in the last third of the “Kontakt”-section (not at the beginning).
It looks like this: http://s19.postimg.org/o2r0iq2yr/Anchor_Problem_01.png but should look like this: http://s19.postimg.org/3stp3l1tv/Anchor_Problem_02.png.

Kharis recommended the plugin and the script mentioned above because on each different screen resolution there is a different place(? don’t know the right expression, sorry) the anchor is ending up - this can’t be settled by changing css statements. E. g. coming from sub page and choose “Kontakt” in the navigation I end up on main page in the “News” section.

Look: http://s19.postimg.org/7dpkmt6df/Anchor_Problem_05.png (resolution 1376x768)

The problem affects every anchor and every screen resolution differently.

If it helps: Please look for yourself into the conversation I had with Kharis regarding this problem: https://athemes.com/forums/topic/please-help-anchors-dont-work/ (especially conversation December 15, 2015 at 9:10 am).

The plugin settled the problem completely - regarding the different screen resolutions, too.

Thank you for your help!

Beate

Hello again Beate,

I have tried to reproduce scrolling issue on my end by going to single post page to contact page, but scroll was precise, and I couldn’t reproduce it.

After your explanation, I understand why Kharis recommended this approach. If header footer script plugin is causing issue with menu, you can apply custom js code from child theme functions.php file. In order to test if ti si going to work you can first add it to main theme functions.php file like this:

  1. inside theme folder / js folder create file my-scroll-script.js and add js code to it like this:
;(function($) {

$(window).load(function () {

var currentElem = $('#' + window.location.hash.replace('#', ''));

if(currentElem) {
$('html,body').animate({
scrollTop: currentElem.offset().top
}, 1000);
}

});

})(jQuery);
  1. After that, at the end of functions.php file add following code:
if ( ! function_exists('my_custom_scroll_functions') ) {
	wp_enqueue_script( 'my_custom_scroll_functions', get_template_directory_uri() . '/js/my-scroll-script.js', array('jquery'),'', false );
}

In this way same script will be added to header of your page, and it should work, like it worked with the plugin.

Let me know if it is working now.
All the Best!

Hello Dimik,

Great work so far I’ve had the time to test it. It seems to work properly. Please do not close issue by monday I try further testing over weekend with other resolutions.

Question: Do I have to save functions.php in future when I update theme?

I really appreciate your help!

Thank you very much.

Beate

Hello Dimik,

now I noticed that the old mainnnav mobi problem occured with mobile devices. It has something to do with the script itself then, not with the plugin. Instead of mainnav mobi mobile devices choose the mainnav navigation.

Look: http://s19.postimg.org/gbozs50ub/Mainnav_Mobi_Problem_01.png

and http://s19.postimg.org/t4d3s2cg3/Mainnav_Mobi_Problem_02.png

Just examples. It’s only working with 320 px width. All other widths display the mainnnav not the mainnav mobi.

Any idea?

Thank you very much for your help!

Beate

Hello Beate,

If you want to remove js error form google chrome console, you can change js file like this:

;(function($) {

$(window).load(function () {

var currentElem = $('#' + window.location.hash.replace('#', ''));

if(currentElem.length) {
$('html,body').animate({
scrollTop: currentElem.offset().top
}, 1000);
}

});

})(jQuery);

Only this part is changed:
if(currentElem.length)

After that, you will see that there is no more error in the console, but the issue will probably remain on your end. See, I have tested this on my end http://screencast.com/t/4IRfH2K3 and mobile menu is working, so there is probably conflict with some other script / plugin which you haven’t disabled.

Please, try to disable plugins again, something else is probably causing 3 way conflict. If that does not work, then remove custom JS code. That is the only way since we cannot provide further help with this because this is custom coding, and we primarily need to focus on providing theme support to customers regarding default theme functionality.

I hope you understand.
All the Best!

Hello Dimis!

Sorry for being late, I was in hospital for 8 days.

I do not understand why this error concerns the google chrome console because I work with mozilla. I only test with chrome, IE, opera and safari.

During next days I will again disable plugins and try my best.

By the way I understand your point. Of course.

Thank you very much.

Beate

Hi all again.
My question is:
What you think about next american president?
Just interesting :slight_smile: