PHP mobile redirect Endless loop

Disable the plugin at all and in your function.php add add_action(‘init’, ‘my_mobile_redirect’); function get_first_url_subdir() { return str_replace( str_replace( array(‘http://’, ‘https://’), ”, get_site_url() ), ”, $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’]); } function redirect_mobile_with_cookie() { $cookiename=”redirect_mobile_is_a_mobile_device”; if ( isset($_COOKIE[$cookiename]) && ($_COOKIE[$cookiename] == ‘yes’) && strpos(get_first_url_subdir(), ‘/mobile’) !== 0) return true; return false; } function my_mobile_redirect(){ if ( redirect_mobile_with_cookie() ) … Read more

WordPress and IPN problem

First of all, is better use get_template_directory_uri() instead of bloginfo(… <input type=”hidden” name=”notify_url” value=”<?php echo get_template_directory_uri(); ?>/ipn.php”> but you are right if you think the problem is not this one. I cannot be sure, but I bet your problem is here: include_once( $_SERVER[‘DOCUMENT_ROOT’] . ‘/wp-load.php’ ); This is a problematic way to include wp-load.php, but … Read more

External PHP file & Pretty Permalink

I can’t say I’ve ever tried including wp-load.php directly, but I’ve had success using: define(“WP_USE_THEMES”, false); include(“wp-blog-header.php”); … when trying to invoke WordPress stack in a non-templated workflow. wp_blog_header.php does make the call out to wp-load.php but also wires up some other stuff (such as calling wp()).

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)