How do i create a list-posts-page?

Assuming you’re only trying to display your blog posts index on a page other than the front page (i.e. because you’ve assigned a static page as your site front page), you shouldn’t need to do anything special. Refer to the Codex for step-by-step instructions for creating a static front page and separate page for your … Read more

Organize template parts and page templates in folders in regards of template hierarchy

Page templates are special case and since WP 3.4 can be put in subfolder natively. Other than that WP mostly expects flat file structure for templates. While template hierarchy is easily adjusted (see dynamic filter in get_query_template(), pretty much only thing needed)… From personal experience – overly extensive and nested directory structure for templates makes … Read more

Trying to query all posts in category 4

For your issue regarding only returning 20% of your posts, try the following <?php query_posts(‘cat=4&posts_per_page=-1’); ?> Note: By default, 10 posts are returned. -1 will return all posts in the resulting set. http://codex.wordpress.org/Function_Reference/query_posts#All_Posts_in_a_Category — For your question about passing through the Category Name, you can pass through the category_name as parameter, which accepts the category … Read more

Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy

This is minimally tested– nearly untested really– but: function force_archive_php_wpse_88824() { if (is_main_query() && is_archive()) { include (get_stylesheet_directory().’/archive.php’); exit; } } add_action(‘template_redirect’,’force_archive_php_wpse_88824′); You are interrupting the template load process and forcing a file of your choice to be used. Reference http://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect http://codex.wordpress.org/Function_Reference/get_stylesheet_directory

new custom theme – posts displaying on top of one another

You have closed div having content class inside if statement which causes to break nested markup, instead close it outside if statement as following. <?php /* Template Name: Blog */ ?> <?php get_header();?> <div id=”blog-container”> <div class=”content”> <?php get_sidebar( ‘blog’);?> <?php if(have_posts()) : while(have_posts()) : the_post(”); ?> <div class=”meta”> <h3><a href=”https://wordpress.stackexchange.com/questions/89410/<?php the_permalink(); ?>”><?php the_title(); ?></h3> … Read more

How to slice down index.php from a template and import from another file?

You can include other files in the way you’re describing by using get_template_part(), see: http://codex.wordpress.org/Function_Reference/get_template_part. This is intended for sections of code that you intend to reuse elsewhere on the site. However, if you’re only using these layouts (“list”, “full thumbnail”, etc.) on the home page, then it’s quite fine to put them all in … Read more