This page contains the following errors:
error on line 3 at column 6: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.
依ChatGPT給的建議,一下子就找到問題!!
結果是自已的主題functions.php,結尾多點了二行XD
發現新架的站,有og:image網址沒辦法讀取的問題。
新站
https://i0.wp.com/hansiangpets.com.tw/wp-content/uploads/migra/product/c7f8a297546d4d14866f02b11024e03c505db800.jpg
https://i0.wp.com/haoyipets.com/wp-content/uploads/migra/product/308806d7812f10c4fa41cabb79e19673f7b0e349.jpg
Sorry, the parameters you provided were not valid
舊站
https://i0.wp.com/ds5168.com.tw/wp-content/uploads/migra/product/934cb7c8d5fe93d1b6f086955e5bd3aa48378f9c.jpg
雖然可以加ssl=1可以解決,但發現有些站台並不需要處理。
原來忘了開cf端全走Https的設定。
function redirect_page_standard() {
wp_redirect( get_site_url() . '/notice.html', 301 );
}
add_action( 'template_redirect', 'redirect_page_standard' );
https://tinypng.com/developers
if($user){
//do the single sing on
wp_set_current_user( $user_id, $user->user_login );
wp_set_auth_cookie( $user_id );
//email
// echo $user->user_login;
do_action( 'wp_login', $user->user_login,$user );
}
function so_26675676_your_function($user_login, $user) {
// your code
}
add_action('wp_login', 'so_26675676_your_function', 10, 2);
add_filter( 'woocommerce_login_redirect', 'krex_redirect'); add_filter( 'woocommerce_registration_redirect', 'krex_redirect'); function krex_redirect( $redirect_to ) { if ( ! empty( $_REQUEST['_wp_http_referer'] ) ){ $ref = wp_unslash( $_REQUEST['_wp_http_referer'] ); } return $ref; }
/*----------------------------------------------------
------------------------*/
// redirects for login / logout
/*----------------------------------------------------------------------------*/
add_filter('woocommerce_login_redirect', 'login_redirect');
function login_redirect($redirect_to) {
$location = $_SERVER['HTTP_REFERER'];
wp_safe_redirect($location);
exit();
}
add_action('wp_logout','logout_redirect');
function logout_redirect(){
$location = $_SERVER['HTTP_REFERER'];
wp_safe_redirect($location);
exit();
}
| wp_posts table | |||
|---|---|---|---|
| --post_status:inherit,draft,publish,trash,auto-draft,pending |
|---|
| --post_type:attachment,nav_menu_item,page,post,revision |
|---|