Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Changing an Ajax theme into a 'normal' one? WordPress

  • REFUNDED

I'm using a Theme Forest theme: Pluto (http://themeforest.net/item/pluto-fullscreen-cafe-and-restaurant/534738)

It's very nice looking but as it's Ajax driven and doesn’t support custom permalink...

So as soon as the website appeared on Google all link referred send to some black page which seem to be out of the website:

Link appearing in Google: http://www.thaiorchid.be/contact (black page)
Compared to the real webpage: http://www.thaiorchid.be/#menu-item-19

Any way to cut that Ajax style navigation from some part of the website and have the correct navigation /contact ?

Many thanks,
Jonathan

Answers (4)

2012-05-24

Francisco Javier Carazo Gil answers:

Jonathan,

Have you tried this? From [[LINK href="http://stackoverflow.com/questions/4865770/ajax-navigation-in-wordpress-trouble-with-permalinks-solved"]]SO[[/LINK]]:

here's the usual dilemma with AJAX requests for content only in WP: You want the link, when clicked load a page as usual. But you also want to use the same link to load the same page via AJAX and then you don't want the layout to be loaded as well.

Assuming that this is the core of your problem, here's how I handle this usually:

// functions.php
function is_ajax_request() {
return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
}


// e.g. in index.php or any other template file:
<?php if (!is_ajax_request()) { get_header(); } ?>

// ... Rest of your template ...

<?php if (!is_ajax_request()) { get_footer(); } ?>


Jonathan Surinx comments:

Thanks for the reply, I tried your suggestion but I don't seem to be able to make it work.

2012-05-24

Sébastien | French WordpressDesigner answers:

is it not better to make a redirection to http://www.thaiorchid.be/#menu-item-19 from http://www.thaiorchid.be/contact

(no redirection if it's an ajax request)




function is_ajax_request() {
return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');

}


/*in page.php*/
if (!is_ajax_request()) {

if (is_page('contact') {
header('Status: 301 Moved Permanently', false, 301);
header('Location: /#menu-item-19');
}
}




Sébastien | French WordpressDesigner comments:

with this method, google will use http://www.thaiorchid.be/#menu-item-19


PS : you could probably rewrite url in jquery


Jonathan Surinx comments:

It's maybe an idea but I've got about 50 pages in the website + translations coming...


Sébastien | French WordpressDesigner comments:

hum...


you can probably modify the jquery. It's possible to use permalink like in this theme
http://www.wizzmyworld.com/#wizz-my-event

2012-05-24

Agus Setiawan answers:

theme is fully AJAX and custom permalink is not support.


Jonathan Surinx comments:

Thanks ;)

2012-05-26

Arnav Joy answers:

Hi Jonathan ,

Can you provide me access to your site , I would like to have a look into it.

my email is : [email protected]

skype : arnav.joy