Create Folder inside Wordpress theme - wordpress

i developing a new theme for my website and i want to add 2 languages inside it. but every language have it's own folder inside theme.
so i created two Folders (en) and (ar) inside my wordpress theme which everyone include php files but when the website loaded i can't access them and got a white page without any code inside it.
example:
www.website.com/en/index.php
www.website.com/ar/index.php
how i can create them and access them like normal html pages?
please help me to fix this problem.

The index.php for your homepage isn't in your Theme folder: it's in the top directory of the WordPress install.
For me (on Apache) the index.php you are talking about is at:
/public_html/index.php
You're modifying the index.php that (for me) is found at:
/public_html/wp-content/themes/mythemename/index.php
I'm pretty sure what you're wanting to do would look like this:
/public_html/en/index.php
Let me know if that works!

Related

Can I have a dynamic and static website at the same time?

The situation is the following. I’m a beginner developer. Bought a domain and a simple hosting plan (includes 1 Msql base). I created a static HTML page. I modify it sometimes to show my progress.
Now I want to practise WordPress. Is it possible to keep this static webpage and create another dynamic page in WordPress? So this static page will be the main where I’ll put a link for the dynamic page.
Sorry if my question is too simple. I couldn’t find the answer anywhere.
Thanks!
Yes, you can create sub folder in public_html directory something like /public_html/xyz. so your domain will be xyz.com/xyz
now you can install wordpress in xyz folder and create dynamic website there.
Maybe you can use a sub-domain, they are normally free inside the hosting plan. You can have a folder for the html and other folder for the WordPress. Then just assign the correct folder for the main domain to the html and the subdomain.whatever.com to the WordPress.
Yeah there are a few ways to do it. Simplest is to name the page "index.html" and stick it in your root (public_html) directory. That page will display instead of the index.php file Wordpress uses, at least for the homepage.
Wordpress should "take over" if you navigate to any other URL.

how to view and edit a wordpress php file locally (MAMP)

I am helping out creating a few wordpress templates. I've been sent over the basic content (wp-admin/wp-content/wp-includes folders and other wp-* files).
They've already created a new theme, and one front-page.php file. This file includes "parts" such as get_header and get_footer.
Essentially now they'd like me to create new templates using this theme, and php variables to make updating easier. My question is - how can I view this so I can see what i'm making?
I downloaded MAMP and set up a local server, and if I create a sample .php file in the htdocs folder, that page appears correctly. However when I paste the Wordpress folder that I was sent, nothing loads. Is there a special way to get a front-page.php including partials to load within a theme? Am I missing something obvious here?
You will have to Install WordPress completely in order to make it work. Then you will be able to add your folder in the "Themes" folder of WordPress..
You can Google "How to Install WordPress on Mamp" for more info... you will find plenty of websites helping you.
I also suggest you read a few blog post on how to create WordPress Themes... :)
Good luck

Have a subfolder not controlled by wordpress

I have wordpress installed on the root of my website (say example.com/), but there is a folder of the website that i want to directly build in php/html not controlled by wordpress - basically I want it to be its own separate entity, but with the url being example.com/folder/, so it sits under wordpress in the url hierarchy, but is completely independant... Is that possible? I have done some research but cant find a solution or any reference to this.
Thanks very much for your help!
Just make the folder in the root directory of the wordpress install. Any files inside of that folder that does not declare the wp-load.php file will not be controlled by wordpress.

Modifying custom Wordpress pages

Sorry if this question is too basic (It would be great if someone could recommend me on a good resource/tutorial for starting up with wordpress development)
I am new to wordpress development. And I work on a Mac.
I downloaded MAMP, installed wordpress, and installed a custom theme which I bought online.
So far, I've been using the wordpress wp-admin interface to customize the theme.
I created a new Page called "myPage". I'm interested in making some design changes to myPage but the wp-admin tool is limited and I realized I have to start looking/modifying the code.
I'm using Netbeans, and created a new project of my local wordpress folder which contains the wp-admin, wp-content, wp-include folders.
However, I am not sure where in the code to find the page I created "myPage", in order to modify it.
I ran a search on all the code but I don't find any mention of it.
I guess my custom page is saved elsewhere? in the database?
Thanks!
Drill down through wp-content > themes > to your theme's folder. Inside there you will find a file called page.php. That is your default page template. To double check this is the page being used, in your wordpress backend, edit the page and on the right hand side in the 'page attributes' panel, you will see a dropdown under 'Template'. You're purchased theme may have many templates, so that is how you can tell which one is being used.
Note: Creating a page inside of the wordpress backend does not actually create a new page file for that page.
Hope this helps.
Yea, you can find your page in DB, check out link for more info.
To access your database, you need to go to url http://localhost/phpMyAdmin/ if everything is set right; or your local IP/phpMyAdmin/ if host alias is not set.
EDITED
If you are looking for file, you should look in wpfolder/wp-content/themes/some-theme/ and now ether page.php or content-page.php I am not sure.

Blank page on localhost/wordpress/wp-content/themes/mysitename

I'm creating my own WordPress theme and I've set it up locally with MAMP. It all works fine and the theme appears when I enter localhost/wordpress in my browser. But when I enter localhost/wordpress/wp-content/themes/mysitename it is just a white blank page.
In the WordPress dashboard under themes the image next to my theme where it lets you activate it is also blank.
How can I get it to appear? Thanks in advance!
WordPress uses a frontend controller system where all site traffic passes through the index.php file in the root of the site.
Directing your browser to "localhost/wordpress/wp-content/themes/mysitename" bypasses the main controller, which means you are bypassing WordPress altogether and attempting to directly access files on the server. That directory would need to have an index.html or index.php file within it to produce some kind of output.
In order to have an image beside your custom theme in the admin, you need to create a screenshot of your theme and name it "screenshot" (can be a jpg or png) and place it in the root folder of your theme. Look inside other WP theme folders for an example of what I am talking about.

Resources