Migration to WP - Couldn't load image

Situation: I'm trying to migrate static page made with HTML/CSS/JS into Wordpress. The images won't load. They work in HTML, but when I migrate into PHP there are only alt-descriptions visible. Upon examining it in the Mozilla Dev Tools, there is a correct link to the image that displays the image upon clicking. However, on the migrated WP site there's an error "Couldn't load image". Directory seems correct, but image just won't load. What I tried. get_theme_file_uri() <img src="<?php echo …
Category: Web

subdirectory index.php is not working

I have setup wordpress in the root directory and at the same level I have some other directories e.g named "sq". Under sq there are subdirectories like first, second, ... under each subdirectory there is index.php file. Problem is when I am accessing http://example.com/sq/first it is giving me 404 page of root wordpress. I tried index.html instead of index.php and that is working. So index.php is not woking and I need php not html. I have tried all the possible …
Category: Web

Site redirects to wrong url when saving settings

I have a subdomain: https://blog.example.com/ I forcibly redirects to subdirectory: https://www.example.com/blog By changing site URL and some RewriteRule on .htaccess. Now the website and admin works fine except a small issue like when I tried to click save button on settings page (eg: Setting > Writing ) the site redirects to main domain: https://www.example.com/wp-admin/options-writing.php?settings-updated=true /blog is missing in the URL and end up in to main website 404 page. My .htaccess file looks like : # BEGIN WordPress <IfModule mod_rewrite.c> …
Category: Web

After changing wp from subdirectory to root I can't preview any changes to a page or post

I followed the guideline from WP Codex. Changed the site url in general settings Copied the .haccess and the index.php files from the subdirectory to the root Edited the root index.php (new copied file in root) from: '/wp-blog-header.php' ); to '/subdirectory/wp-blog-header.php' ); checked the permalink structure. the following code is in the new copied root .haccess file # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] …
Category: Web

add 360 (non-Wordpress) tours in a subfolder with the same name as the main (Wordpress)page of the 360 tours

I'm looking for a solution to put my 360 tours (all in their own subfolder) in the subfolder of the Wordpress page about the tours. For instance: Wordpress page: domain/vr/ Tours: domain/vr/tour1/index.html domain/vr/tour2/index.html The tours are not made in Wordpress and have been uploaded via ftp. Can anyone help me? :)
Category: Web

Getting Images from theme's directory in pages

Yes, I know that we have get_template_directory_uri(); in referencing to the theme's directory. It's working when I put the following code inside index.php or in header.php: <img src="<?php echo get_template_directory_uri(); ?>/images/sample.png"> But when I'm adding an image inside pages when editing via text, not in visual, it isn't working. How can I get the images from theme's images directory into the pages? Thanks!
Category: Web

How to move page template files like page-{slug}.php to a sub-directory?

I want to move page template files like page-{slug}.php to a sub-directory within my theme, in a way that WordPress will recognize them automatically. If the page templates of the said form doesn't exist within the sub-directory, then WordPress should fall back to the default template loading rules. How can I achieve that? Note-1: This question and corresponding answers are more generic for page templates and this link mentions template-parts/page, which is not the same thing. Note-2: I have multiple …
Category: Web

Missing a temporary folder.error when image is uploaded in admin Set temporary Directory - Wordpress 5.2.2

I am finding this error when I try to upload image in backend Missing a temporary folder. Tried setting temporary folder in wp-config.php with necessary permissions. Tried to set the temporary directory path in global and local php.ini files. No fix yet. When uploading image found the below errors 2019/08/31 05:16:52 [warn] 12906#12906: *853 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000278, client: , server: , request: "POST /wp-admin/media-new.php HTTP/1.1", host: ".com", referrer: "wp-admin/media-new.php" 2019/08/31 05:16:53 [error] …
Category: Web

Cannot Override Wordpress 404 for a Sub-Directory

I have wordpress installed on my root (/var/www/html) and I have a sub-directory in the root as /var/www/html/manage Both directories have it's own .htaccess files. Content of the .htaccess are as follows. /var/www/html/.htaccess (root) # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress /var/www/html/manage/.htaccess (Sub-directory) # Start Manage .htaccess RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php ErrorDocument 404 …
Category: Web

Wordpress page for one specific page on Google Cloud hosted website?

I was wondering if it was possible to create a subpage within a Google Cloud hosted website, and install Wordpress on that subpage ONLY, so that I can manage this subpage on Wordpress without having to touch anything else. Our company website is hosted by Google Cloud, and was created by developers. We want to start a blog, but since coding it from scratch takes a lot of work, we want to see if we can apply wordpress to just …
Category: Web

Permalinks not working on second wordpress installed in a subdirect

I have a main wordpress installed on the root and now due to a long story about incompatible plugins I need to install a second full instance of wordpress in a subdirectory. The main site works fine, as does the site in the subdirectory. As long as I don't activate pretty permalinks on the subsite Once the subsite has permalinks on only the home page is accessible, any other page is captured by the main install that spits out a …
Category: Web

Multisite, different domains, optional subdirectory, and htaccess

Here's the situation: Configuration I have a WordPress multisite setup where different sites are on different domains. Some of those sites are contained in a subfolder in their domain, some are not. For the sites where they are in a subfolder, the subfolder name is the same across all sites. Here's the examples: Site | URL ----------------------- Main site | example.com Site A | sitea.com Site B | siteb.com/foo Site C | sitec.com/foo Site D | sited.com Here is the …
Category: Web

htaccess, site and staging in subdirectories

I have the following task and as it is a little different from most setups, I couldn't find any hints that solved my problem. WordPress for the live site was installed into a subfolder /wp1, the .htaccess directives are a rewrite to www and https followed by the usual WP directives: <IfModule mod_rewrite.c> RewriteEngine On # rewrite any request to the certified domain to use www RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # rewrite to HTTPS RewriteCond %{HTTPS} off …
Category: Web

wp-admin redirects to subdirectory after moving installation to subdirectory

I have moved a wordpress installation to a subdirectory, from var/www/html to var/www/html/wp-blog mainly to make it future proof. I have followed the instructions in the codex. My server is configured as such I have a nginx reverse proxy which directs calls to blog.mysite.com to the port 8080. Apache listens on 8080 I have modified the .htaccess from what is given in the codex and it is as follows .htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^blog.mysite.com$ RewriteCond %{REQUEST_URI} !^/wp-blog/ …
Category: Web

Install second wordpress in root subfolder, Error 404

I am trying to install wordpress in a subfolder of an existing wordpress installation. I created a the subfolder /wp unziped a fresh Wordpress download inside of that directory and added a .htaccess with the following content: RewriteEngine On RewriteBase /wp/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp/index.php [L] However if I visit mysite.com/wp I get an error 404 not found. I already tried the following: Restarting Apache and adding the .htaccess content to …
Category: Web

Why is there /index.php/ in all my links? How do I remove it?

I recently realized that my rss feed is not working, because a plugin was assuming it's under mydomain.com/feed But it isn't. I get an 404 error. I figured out that instead my feed is under mydomain.com/index.php/feed I already had similar issues in the past when using Easy Affiliate Links. For example when I created a link that was supposed to be: mydomain.com/visit/google The link that worked was mydomain.com/index.php/visit/google My blog url is equally annoying: mydomain.com/index.php/blog It's not a minor annoyance …
Category: Web

get main URL from subdirectory with php

I have a WordPress site that contains multiple subdirectory installations of WordPress with individual databases inside one WordPress installation, and I want to link them together in the themes. But I couldn't figure out how to dynamically get the main URL from the base WordPress directory for one of the subdirectories. For example, I tried to use get_home_url() but it only returns https://mytestsite.com/instance1 instead of https://mytestsite.com This might be something basic but i couldn't find anything in my resarch that …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.