Using WordPress solely as a Backend – dealing with WP_SITEURL
Using WordPress solely as a Backend – dealing with WP_SITEURL
Using WordPress solely as a Backend – dealing with WP_SITEURL
“Home page / Archives” stat doesn’t necessarily represent the number of views of a single page, although it might if your front page is a static page. The meaning of, and reason for, the designation was briefly addressed by staff member macmanx, shortly after WordPress evidently changed this stat from “Home page” to “Home page … Read more
I fixed it. This behaviour was due to a redirect loop from “home” to “home”. Adding the following line to wp-setting.php dit it for me. Sadly this is only a workaround. Maybe someone can hint me to a better fix. remove_action(‘template_redirect’, ‘redirect_canonical’);
Remove Home page slug in translated pages
Got 404 error when changed siteurl via DB in WordPress
one url for all pages
In Settings > Reading you can choose any Page to be displayed as your home page.
There are two ways of seeting the Site URL. In the dashboard. In the wp-config.php file. In the functions.php file. If you cannot change Option 1 above, then you should NOT edit the table in PhpMyAdmin. Check for the following in wp-config.php: define( ‘WP_HOME’, ‘http://example.com’ ); define( ‘WP_SITEURL’, ‘http://example.com’ ); If you can’t find that, … Read more
If you’re just trying to display different content to logged-in vs. logged-out users, I’d recommend using the the_content filter. add_filter( ‘the_content’, ‘wpse_387084_content_selector’ ); function wpse_387084_content_selector( $content ) { if ( is_front_page() && is_user_logged_in() ) { $page = get_post( 2516 ); $content = $page->post_content; } return $content; } The above code assumes that you’ve set the … Read more
Not tested well but you can try this. add_action( ‘template_redirect’, ‘my_homepage_redirect’ ); function my_homepage_redirect() { if ( is_home() || is_front_page() ){ $page = get_posts( [ ‘post_type’ => ‘page’, ‘posts_per_page’ => 1, ‘orderby’ => ‘rand’, ‘fields’ => ‘ids’ ] ); if ( empty( $page ) ){ return; } // update the front page id option according … Read more