Parallax effect issue. Position fixed issue

Everything was working fine. I never changed a line of code, but site is behaving unusually instead of opening that pop now it is creating an undefined URL. I was struggling from 3-4 hours reading every line of code that I have written. Can you please guide me what steps should I take and where should I look forward to further troubleshoot this?

You must have changed something?

Where is your custom js file It doesn’t seem to be in the directory that you are pointing to:

Probably not related to this issue but you haven’t tidied up the errors I pointed out before in previous posts as there are still errors showing for them in the web console.

@PaulOB

Sorry for diving in the discussion.

Normally people work on the child theme. It should be here. i checked and its in child theme →

Click Here

No worries :slight_smile:

That’s not what I was looking for anyway so I’ll have to go and have another look :slight_smile:

2 Likes

Using a child theme is a very good idea. But it looks as though the child theme’s function.php file is empty. Don’t you need to “enqueue” for things to work?

2 Likes

Hi there,

it is already there in child themes functions.php =

function enqueing_scripts() {
    wp_register_script('my_amazing_script', get_template_directory_uri() . '/js/custom.js', array('jquery'),'1.1', true);
    wp_enqueue_script('my_amazing_script');
}

add_action( 'wp_enqueue_scripts', 'enqueing_scripts', 999 );
1 Like

I think the issue is that you have now added full urls to your anchor links and previously you just had the fragment identifier in the anchor url.

You only want to jump to the target pop up not to a new page with a popup.

You have this:

<a href="http://www.xxxxxxxxxxxxxxxxxx.co.uk/#target-content">

When you just want this:

<a href="#target-content">

3 Likes

I suppose you could just hard code the JS instead.

e.g.

Do this:

  <script>
(function($) {

   $('#menu-footer-menu li:last-child a,#menu-footer-menu li:last-child').removeClass('menu-item');	
   
	$(document).ready(function(){
    	//var href =  $('#menu-footer-menu a[href="#target-content"]' ).attr('href');
	// assumes you always have a popup with an id of target-content   
       var href = "#target-content";
	   setTimeout(
  		function() 
  		{
    		window.location.href = href;
  		}, 5000); 
	});
})(jQuery);
</script>

Of course you probably should check that the id exists first or you will get the 404 like last time if you ever change the id.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.