WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I have a particular installation of WordPress, and I would like to know what is the name of the .php file to access to the blog.

So to sum up :

I have a navigation like that : HOME / PORTFOLIO / BLOG /CONTACT

By default, the user arrives on the home which use "front-page.php" which display excerpt of last entries.

I would like when the user click on "BLOG" they go to the list of posts. But what template should I use ? Beause If i use "home.php", my URL will be mysite.com/home, and not mysite.com/blog as I want...

Could you help me please ?

Thanks a lot !

EDIT this is my link:

 <li><a href="<?php echo site_url('blog');?>" title="blog">Blog</a></li>

How could home.php be loaded whit that URL ?

share|improve this question

Use home.php, that’s the template for the list of newest blog posts. It will not affect the URL.

If you go to wp-admin/options-reading.php and choose a page for Posts page – this page will use home.php. So create a static page, assign the URL /blog/ and select it in the settings. WordPress will take care of the rest.

share|improve this answer

Create two pages in WP admin >> Home and Blog

Now, code your front-page.php to show the excerpts. You can create a template for "Blog" name it as : blog-page.php write your code there and from WP admin change the template for "Blog" page you created. When you edit "blog" page in WP editor you will see "Page Template" in right column, from the dropdown you can select the template you created. This will work perfectly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                       <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\n                </div>\n            </div>\n\n            <div id=\"copyright\">\n                site design / logo &#169; 2016 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\n            </div>\n            <div id=\"svnrev\">\n                rev 2016.2.5.3240\n            </div>\n                <div id=\"additional-notices\">\n                    WordPress is a trademark of the WordPress Foundation, registered in the US and other countries. This site is not affiliated with the WordPress Foundation in any way.\n                </"], "copyright__copyright__copyright": [" as : blog-page.php write your code there and from WP admin change the template for \"Blog\" page you created. When you edit \"blog\" page in WP editor you will see \"Page Template\" in right column, from the dropdown you can select the template you created. This will work perfectly.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}