0

I'm creating a custom theme for a Wordpress website for my client.

As far as I held the theme on my localhost wordpress website, everything was fine - when let's say browsing the home page and clicking on the link, a specific subpage was loaded from start to finish - it was totally okay.

Now, on the client's website my theme works like this: When browsing the homepage and clicking on the link, instead of loading the page, Wordpress adds its content under the content of the homepage and it seems like its doing it without reloading. In order to see only the content of the subpage, I need to refresh the page.

Plugins installed:

  • Activity Log for MainWPAdvanced Custom Fields Alpine PhotoTile for Google Plus and Picasa Block Bad Queries (BBQ) Contact Form 7 Display Posts Duplicator Google Analytics for WordPress by MonsterInsights MainWP Child Jetimpex Dashboard Plugin Security Scanner Really Simple SSL Remember Me Controls Site Kit od Google Sucuri Security - Auditing, Malware Scanner and Hardening UpdraftPlus WordPress Importer

Explanatory image: Explanation

AdamsRX
  • 33
  • 1
  • 6
  • You should IMHO really rather ask your client resp. their developer about the details of their system, instead of giving this to us to guess what the exact issue might be. It is probably some sort of AJAX / “make me into a one-page” plugin or something, perhaps not configured correctly. Or your theme is not prepared for what specific requirements using it might entail. – CBroe Mar 23 '20 at 13:32

1 Answers1

0

You can use Ajax, for example,

<a href="home" data-id="23" title="home">Home</a> 
<a href="about" data-id="24" title="about">about</a>
<a href="Contact" data-id="25" title="contact">contact</a>

23 is the page id home, 24 for about and ...

then you create a javascript file and write a javascript code that when the user clicks the link, the ajax trigger and send data-id to backend.

So, create a function PHP in backend and get data with page id and return the content with wp_send_json...

below link helps you implement an ajax in WordPress:

How to call ajax in wordpress

Hossein Shourabi
  • 426
  • 4
  • 15