I want to create my own index.php file and make wordpress call this page first allways,there is a way to do that?
I want to keep all the wordpress template and sites just want to call a new front page (php file) created by me.
There is a lengthy explantion on how to create a static front page for WordPress.
Related
I would like to roll out static content via a word press plugin. Lets say the folder rolled out is located at domainname.com/wp-content/plugins/pluginname and I would like to access it via domainname.com/pluginname for example.
I have the following quesitons:
How would you roll out this folder if you like to have it some kind of installable.
How do we solve the access via the desired url?
Thank you for helping!
I am not sure what you are trying to achieve exactly, but here is a possible solution.
Create a custom page template in your (child) theme folder by making a file and include that will hook your custom template page to WP. (See this page for more information) On this page your can basically pull any WordPress functionality that your require.
<?php /* Template Name: Example Name */ ?>
Switch on Post Name option in your Permalinks settings for pretty permalinks and then create a new page in WP that will use your newly created template. On that URL you can access the code that you've supplied in the custom page template.
I'm fairly new to Wordpress and using the html5blank theme for the first time. I've built the home page with all the code on the page.php file. I have a host of other pages I need to create which I've started doing on the wp-admin dashboard but what I can't seem to figure out is where I put the code for each page?
Do I create individual text files for each - product.php / about.php etc ? How do all the different paths link up on the site?
I'm sure this is a really straightforward thing for an experienced WP developer. Any help appreciated.
You can create a file called aboutus.php and add this at the top.
<?
/*
Template Name: AboutUs
*/
?>
This wil make the template show up on the page atributes in wp, where you can select it as the template for your page. This is very basic... you can read up on template files here... https://developer.wordpress.org/themes/basics/template-files/
[NEW AT WORDPRESS]
I'm creating my own wordpress theme with own css etc etc. I've managed to get everything good in the index.php file, and I'm trying to make the other pages as well now.
When I make the home.php, blog.php, about.php and contact.php file (in my theme folder) they don't link to it. I'm following the "WordPress 3: Creating and Editing Custom Themes with Chris Coyier" on Lynda.com and the example shows that whenever you make a file with the same name as your page, it takes that directly (which works at his tutorial).
Anyone that could know what is going on?
Example:
I got a file blog.php in my theme folder, and when I go to www.mydomain.com/blog the loaded file is the index.php file, instead of the blog.php file
There are two ways you can get this working using custom page templates.
Create a template for one specific page using the page slug or ID. In this case, change the name of the php files like this to match the name of the page you created in the UI: page-home.php, page-blog.php, page-about.php and page-contact.php
Much more flexible is to create a custom template that can be used on ANY page. Just add the template name to the top of the php file like so (inside the php block):
/*
Template Name: My Home Page Template
*/
Then edit the pages and select your custom template from the template dropdown menu (on the right hand side I think, if its visible).
Reference this page for more info: https://developer.wordpress.org/themes/template-files-section/page-template-files/
Found the solution to my (silly) problem.
Creating a page in your theme directory & adding the template comment at the top of your php file isn't enough. You need to go to the admin panel->pages->YOUR PAGE-> and check out the page attributes. There you can link the page to a certain template: http://d.pr/i/a0m0
If my title wasn't clear, basically what I'm trying to do is to add my own HTML or PHP page to Wordpress, so i can play around with some web dev.
So essentially I just want a test page/pages added to my site. However since I have installed Wordpress on my website, I can't just add "index.html" to my root folder using my FTP client. I wonder if I can/can't do this and if so how to link to the pages I add using FTP.
Sorry if this doesn't make any sense. I just want to add some of the sites I've already made / ones I am creating to my site so I can easily show clients/employers what I can do, and I apologize again if I'm being an idiot.
Create a sub-directory in your root folder and then simply link to it:
www.domain.com/mysubdir/index.php
the other way to do this... create a page template in wordpress
create a php file named: template_mypage.php
You must put this php comment line at the top of your template file:
/* Template Name: My Page */
go to wordpress backend and create a new page
in the "Page Attributes", you can find a drop down list named "Template". In the list, you should be able to find "My Page"... select it and then save your page.
view it!
You can always create a subdomain or create a folder inside public_html/www/ and redirect it from any other domain or from any static link you have on wordpress
Why not use WordPress and put your portfolio together using Custom Post Types? I recently presented on this and there is a handy plugin for Custom Post Types UI that you can create a whole new section of your site and make templates for your portfolio.
Just a thought.
If you do a static page in WordPress, you can still template using the Page system as specified in another comment. Code your page, separate it into header, footer, content, etc files. You can load the file to your root, but not name it index. If you do a subfolder, you need to not have an existing page in WordPress.
HOWEVER, you can still do a "halfway" static page still using WordPress and do a header-staticpage.php, index-staticpage.php, and footer-staticpage.php and make sure to include the code for WordPress header and footer in the new header and footer so you can still reap the benefits of the default jquery that WordPress allows. Don't forget to name your template and when you create the page in WordPress, you can just leave the content area blank if you have hardcoded the page's content in.
I still recommend trying Custom Post Types. It is not hard and there are some great presentations in Slideshare that cover this aside from the plugin I mentioned earlier in this comment.
I have WP instance installed on hosting. I also have one static HTML page in its own folder with some graphic files that I want to use as landing page for the site. I don't want to insert it as WP page or anything like that, want to keep it simple. I have also permalinks configured. So I can't access the page just by going to www.mysite.com/landingpage/index.html now. Is there a simple way to make the static page accessible inside WordPress instance?
For each page, create a template, with the static text you want, the query for the category you want to display, and a copy of index.php of your theme.
Some links you may like to see.
http://wordpress.org/support/topic/creating-a-static-page-that-displays-posts
http://moshublog.com/2007/09/10/static-frontpage-combined-with-dynamic-content/
Wordpress static pages: how to embed content into templates?
Good luck.. :-)