I am trying to get all the posts from my wordpress site to one single page. after implementing the custom theme first i created the page named "blog". In settings->reading i set the post page to blog. I created some posts. but instead of showing these posts my blog page show index page. I have tried same procedure on default activated theme then it is working fine. please let me know what can be the issue for this ?
If you create a page named blog, then the template to produce the content of the page should be called page-blog.php (in your theme folder).
Related
Is it possible to have the loop display posts on home.php? I want to have a static front page using front-page.php and then have the loop show posts on home.php. I put a link to home.php however, it is not showing posts and it is pulling up the index page as well. I thought home.php took precedence for showing blog posts. The only way I can get posts to show up on another page is by using the dashboard and setting reading preferences. Is there a way to avoid this so a user that downloads my theme won't have to change reading preferences for the theme to work as designed?
create a custom function for fetching post in the function.php file and then display it through shortcode in any home or front-page file.
After reading many posts and reading tutorials on the WWW, I still can't seem to get my posts to go to my alternative blog page.
I currently have a front static page called "Home" and a blog page
called "Blog"
I set the Reading settings as follows:
Front Page Displays - A Static Page
Front page: Home
Posts Page: Blog
Now when I create posts, I do not getting any of them to show up on my blog page. Instead the page displays a menu with the following items:
Pages
Archives
Categories
Meta
What am I doing wrong.
In order to use a blog page template, you need to have a page template for it. You can create page templates by following this link.
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.
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?
I'm trying to use a posts page in Wordpress. For the uninitiated, this is a page (other than the home page) which features all your blog posts. You essentially turn on the static home page and point Wordpress at a custom index. Then you tell Wordpress to use another custom template as your "posts page"; thereafter, any post you make will wind up there.
My custom template for the 'Blog' page shows up as expected until I define it as the posts page. When I do, the template reverts to my custom index and I get no posts. When I undefine it as the posts page, it goes back to my template. What am I missing? I'm new to using this method, as it used to be done with a plugin prior to WP 2.9
So, I figured out the solution and wanted to share. Thanks for all your input, everyone.
The problem was with the name I chose for the template. I had called it "blog.php", which works fine when creating an ordinary page template. But when using a page as a posts page, Wordpress has some specific setup rules. The pertinent section of documentation, which I scoured the entire internet for using hours of my life I'll never get back, is hidden here:
Also, any Template assigned the Page will be ignored and the theme's index.php (or home.php if it exists) will control the display of the posts. (from here).
So, I named my template "home.php", since I wasn't using a home.php in this particular install, and I was off to the races. Anyway, thanks for the answers!
BTW, I think this may have been what Richard M was getting at.
Your problem might be in creating "templates" and the single post (single.php) You can create a template for any of your pages by putting this in the top of your page (after the first < ? php:
/**Template Name: ****templatenamehere**** #package WordPress * #subpackage Default_Theme */
...rest of code
This allows you to create a page called "posts" which references your new template. This way you can create a new template and then call it through a page. If this is confusing or you have tried this let me know and I will try to give you more details if you need. Thanks