My understanding is that site_url() returns the location where the WordPress core files are. If my blog is hosted at http://example.com/blog then site_url() returns http://example.com/blog But then how does home_url() differ? For me, home_url() returns the same thing: http://example.com/blog If that's correct, then can I get WordPress to return http://example.com/ ?
In the image below, I set the page Welcome! as my homepage. There is no link to that page, and there is only one way to go to the homepage: click on the banner. However, there is two different items referring to the homepage in the stat. Do you know what are the differences between them?
Recently I Found some error on WordPress sites that when someone enter a question mark after the root domain and type any word, url shows the Home Page of instance: For instance, Root Domain is abc.com abc.com/?anyword should be reached on the 404 not found page which shows the home page. I need help with this Issue: https://www.iadm.edu.pk/?anyword should be redirected to the 404 not found page.
I installed MultiSite with the URL set as http://example.com, but now I want to force all requests to go over HTTPS, so I'm trying to change the URL to be https://example.com. I've gone through the database and updated all the siteurl and home values to have https, but the site still loads over HTTP, instead of being redirected to HTTPS. I know that I could setup some htaccess rules, but that's prone to errors. In regular installations WordPress will automatically …
I have two domains uat1.example.com and uat2.example.com pointing to same wordpress installation. I want to change the home_url and site_url for all links in the website to uat2.example.com, but it should not redirect to uat2.example.com if request comes on uat1.example.com, So suppose someone visits my website. uat1.example.com, it should load it. but all links on the web page then should point to uat2.example.com, So User land on a page using uat1.example.com and click on any link it will send me …
I've put / in my Home custom page link, and locally my server is localhost:3000 and it works fine, but on my server the url is www.mysite.com/theproject, but / there does not lead to www.mysite.com/theproject but to www.mysite.com, but for example the logo which has a link like so <?= esc_url(home_url('/')); ?> works fine on the server. Any way to make the custom page link behave like it has <?= esc_url(home_url('/')); ?> ?
Having installed a LEMP stack (nginx) on Ubuntu 20.04 I can run a fresh Wordpress site in Firefox using the IP address 127.0.0.1 with no problems. Using 'localhost' doesn't work. From another Ubuntu 20.04 in my home network I use the IP address 192.168.0.213 and get just a bare-bones view of the Wordpress site. The HTML shows me that all the links in this case contain the hostname 127.0.0.1 like in my first case. Do I need to have a …
I have a pdf that embedded in a WordPress post. I want to create a random dynamic url for that post, for example: https://example.com/aj3nfjskke383fn Above link should be seen once, it has expiration and we can create another random dynamic url. Moreover, it is not a redirection. Can above requirement be achieved using wordpress? Thank you in advance.
I am trying to implement a language prefix to my Wordpress. I now have working Rewrite rules for %lang% tag, query_var etc. Everything works ok, except for front page. What I am trying to do: allow for example.com/de/ to work as a translation for front page. Also allow example.com/ for default language (no translation). But what I struggle with is understanding how to do a Rewrite rule for front page. So let's say I have two pages: Page A and …
After the update to the new WordPress version, "Blog pages show at most" (Setting >> Reading) is not working. Even if I change the count as 5 there, the homepage shows 10 articles i. It is not changing even I change to any count. For more information, I have two blogs that have the same theme and same WordPress version. One blog has 150 articles, and the other has 300 articles. 300+ article blogs faced this issue. Are there any …
On various admin actions (e.g. delete a post), my fresh WP install (dev.mydomain.com/website) returns to the domain root (dev.mydomain.com) instead of dev.mydomain.com/website/wp-admin/edit.php?some-vars-here. I've setup the WP_HOME and WP_SITEURL to the correct site url, but no difference. Site runs over ssl on Apache (I've added the $_SERVER['HTTPS'] = 'on' to wp-config.php). I am able to browse the complete wp-admin and the post is deleted on a delete action, but just jumps to the wrong url after completion. I feel like I'm …
I have two home pages created in WP. One is set as the front page but for only logged-out users. For logged-in users, they see home page 2 as their home page. However, I want the URL for logged-in users to be the default URL of my site. So a mere redirection doesn't work as I will have "site.com/home-2". Is there a way I could achieve this? The code below came across doesn't work and breaks my site. unction switch_homepage() …
WordPress has certain variables like site_url and home_url and paths for things like plugins, themes, uploads, etc... but it seems there is no easy way to display current TLD domain. This probably requires using PHP preg_replace or something similar but I'm not sure what is the cleanest or most reliable way to generate this snippet? For example for a WP site installed to a URL like https://www.example.co.uk how can you detect the TLD only (and e.g. save it as a …
I am trying to rotate 3 pages as my home page at refresh. Currently I am using this in my functions.php: <?php 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; } wp_redirect( get_permalink( $page[0] ) ); exit; } } add_action( 'template_redirect', 'my_homepage_redirect' ); ?> But I don't want a redirect. I'd like for the …
I wanted to show you this issue. This is happening first time with me in my 10 years career, I have cloned many sites to another domain in past but this is for the first time when I do not see the "site URL and home options" under Wp_Options (phpmyadmin) This is the domain name which I cloned https://13cabsonline.com.au and this is the destination domain https://silverservice.sydney/ I have downloaded and restored files via Backup Widget. Uploaded the file manager + …
I need to help with redirect my page. For example I have websites https://example.com. I need to move content from https://example.com to https://example.com/blog. That is not problem and I do that with a change home_page URL. That work pretty well. But Now I need to add redirect from old https://example.com to https://xmpl.com. I want to do with .htaccess but that does not work. Can you help me guys? Here are some of my attempts of this but both does not …
I'm seeking to echo the domain name (url) without the 'http://' (or 'https://'). I've created the following: <?php $surl = bloginfo('url'); $findh = array( 'http://' ); $replace = ''; $outputh = str_replace( $findh, $replace, $surl ); echo $outputh; ?> also another one (of many) I tried: <?php $surl = bloginfo('url'); echo str_replace('http://', '', $surl); ?> Seems like a simple task, but output still includes the 'http://' when the domain is echo'd. Reviewed other posts here and other sites to no …
Whenever I type my domain, example: www.example.com there is a forward slash that automatically appears in Firefox. Example: www.example.com/ How can I remove this?
Working on my first decoupled site. Backend is handled by WordPress and lives on the subdomain admin.mydomain.com and the frontend lives at mydomain.com. The first issue I saw with the headless approach, was that all permalinks referred to admin.mydomain.com. I wanted to change that so that the backend referenced to my frontend. So I changed my config from: WP_HOME='http://admin.mydomain.test' WP_SITEURL='http://admin.domain.test/wp' to: WP_HOME='http://mydomain.test' WP_SITEURL='http://admin.domain.test/wp' which sorted my issue with the permalinks, but now I'm getting console errors on the WP dashboard …
I deployed WordPress through Bitnami so after adding an SSL certification I started getting warnings from my WordPress dashboard of my site URL not matching with Home URL I was directed to my WordPress settings To reset back to https://www.healthviewonfraweb.xyz instead of http but I saw that I could not do that on the my settings, I had to login my Myphpadmin to do it there but WP-OPTION still has the correct URL which is https://www.healthviewonfraweb.xyz but still not reflecting …