Confusion with front-page.php in wordpress - wordpress

I am slightly confused with front-page.php. I created a page "Home" from the backend of the wordpress and selected a custom template, let's say Food. I also have front-page.php. Now from settings page, I selected Home Page as my front page. But still I visit the website, it shows content from front-page.php.
When I already selected Home page as my front page, then it should show content from food Template not front-page.php. I am confused over this.

Try renaming front-page.php template, so the WordPress will not find it.
Then it should display the "Home" page with the custom template.
More information can be found on Codex site, which states:
On the site front page, WordPress will always use the front-page.php
template file, if it exists. If front-page.php does not exist,
WordPress will determine which template file to use....

Related

Proper setup of custom theme for single page website + separate blog page

I am creating my first WordPress theme with a one-page parallax scrolling style.
I have created my entire website (statically) in the index.php file. It works fine if I set the Admin->Reading setting to 'Your Latest Posts'.
But now I am trying to create a separate page for the blog so I did the following:
I created a file, page.php, with the standard blog page code and gave it a template name.
I set the Blog page on wordpress to use the Blog template.
All other pages (i.e. home, about us, etc.) are set to use default
page template (which should be index.php right?)
I set the Reading settings to Front Page: Home and Posts Page: Blog
All I get is the blog page template for all pages (as if it were the default page template).
How to set up a website like this?
index.php should really be your blog template not your static home page. Make a copy of page.php to page-home.php (or whatever you've named your front page), then put the static content in there. You probably won't even need to assign the template to the page - WordPress will do that automatically based on the file name.
By default, page.php is used for all static pages, index.php is used for whatever you've assigned as your blog page in the "Reading" section of the dashboard. index.php is also the template of last resort, which will be used if WordPress can't find any other appropriate template files.

how to change full posts to excerpt on inner blog page WordPress

in WordPress I have an inner page called "blog", and in settings->reading I have that page assigned as the page for blog posts. I want that page to be excerpt instead of full posts. In the theme page.php is used for the (page) loop for the Blog page, but that's overridden by the assignment of blogs posts to that page and I can't simply change "the_content" to "the_excerpt" in page.php to make this work.
I need some conditional tag code to this happen (or would that even work?) in page.php, or is there another way to accomplish this?
The Wordpress template hierarchy diagram will help you out - Wordpress Hierarchy
Your page.php template displays an individual page, it will not be generating the blog archive page you want to edit. Depending on your theme that will either be category.php, archive.php or index.php.
Just change the relevant file to change the excerpt on your blog page.

How to move the posts index page in Wordpress to another file rather than index.php?

The index page in Wordpress show all the posts (without comments). I would like to make the index.php a static page (not a blog), I already done that. But I don't know how to move the index of posts to other page (say blog.php).
Any suggestions?
Make two new pages: 'Blog' and 'Home'.
Under Reading settings: set 'Home' as static page and 'Blog' as 'posts page'.
This makes 'Blog' utilize index.php. Then you have to setup a front-page.php and copy whatever's in your page.php as a base. Now you can edit your home page as a regular page or edit front-page.php to make changes to your home page.
Dashboard/Settings/Reading and possibly make a page template, too, Page Templates « WordPress Codex, woith a loop.

Why does my blog page only show one post?

I didn't think I would encounter this kind of problem in creating a static front page because this seems to be a very trivial customization of wordpress. I am using Thematic as my parent theme. I created a home.php template and pasted the code from the parent's page template into it. I also created two new blank pages named Home and Blog. I set home.php as the template for page Home. Then I went to Settings->Reading and set my front page to a static page and selected page Home. I also set posts page to page Blog. Now when go to my Blog page, I only see a single post?
What is set for "Blog pages show at most" in Settings>>Reading? Do you have more than one post?

Setting custom homepage for Wordpress blog

I need to have custom page as homepage and I know how to do that (http://www.lancelhoff.com/how-to-set-a-wordpress-static-front-page/), but when I set custom page as homepage, I cannot have latest posts page. So how can I link to latest post pages, because it's address isn't anymore root path?
Create a new Page, for example "Blog", then goto:
http://yourdomain.tld/wp-admin/options-reading.php
and change "Front Page" to for example Home (your homepage) and Posts page to your Blog Page (in this example "Blog")
Now you can link in your header.php your Blog Page:
Blog
and if you save this, you can click on this and will see your Posts. Or you can create a custom Page Template like this Code: WordPress Custom Theme and set this as your Page Template of your Blog. But the First way is easier...

Resources