• Resolved chainzor

    (@chainzor)


    Alrite, so made this wp theme, mkay? It’s neat n’ all, that’s not the problem. I’m fairly certain I’m unaware of some fundamental dynamics, or missed something lame here, none the less: I have a main-page (home) with a custom query for featured blog-entries only – works like it’s supposed to. Then I got some other pages, works fine. Then I applied a custom template to a page called ‘Blog’ in which I applied the loop in it’s purest form:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                        	<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                            <small>on <?php the_time('d, M'); ?> in <?php the_category(','); ?> tagged <?php the_tags(); ?> by <?php the_author_posts_link(); ?></small>
                            <?php the_content('Read More'); ?>
                            <div class="seperator biggap"></div>
                            <?php endwhile; ?>
                            	<div id="posts_navigation">
                                <?php previous_posts_link(); ?>
                                <?php next_posts_link(); ?>
                                </div>
                            <?php else : ?>
                            <h2 class="center">Ikke fundet</h2>
                            <p class="center">Vi beklager, men du leder efter noget som ikke er der.</p>
                            <?php include (TEMPLATEPATH . '/searchform.php'); ?>
                       <?php endif; ?>

    (don’t mind the Danish nonsense at the else-part. 😉 )

    However, when I go to the blog page, only one post shows up, there is no content, and the title is ‘Blog’ instead of what it’s supposed to be. The category, time, tags and author seems to work fine though.

    I’m so lost I’d be better off with a gun than a compass.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Is this Blog page supposed to be pulling in posts? Only I don’t see any custom query that pulls posts from a certain category? As it stands, it’s just another WP Page that will only show the content that is added to that Page via the back-end.

    Thread Starter chainzor

    (@chainzor)

    Nono, this isn’t part of the featured-function. That was actually rather irrelevant. I want it to pull in the regular posts! I’m now 100% certain I phail understanding the system here – I’m thinking ‘therez liek a pool of posts’ and i’m convinced running the loop on a page wille fetch stuff from that pool. I’m obviously wrong?

    Sort of. Pages are designed to pull only their own content. Archive templates such as category.php or tag.php pull in a range of posts based upon their actual filename. So if you want pull a range of posts into a Page, you have to provide an explicit query within that template.

    Example.

    Thread Starter chainzor

    (@chainzor)

    Oh, sneaky (yet in this case, troublesome). Maybe I’m taking the wrong approach then, my goal is to have a page for regular blogs, comments, ect. and then pull out the newest/featured to the main-page. Would I have an easier time setting up my blog-page another way than through a custom template?

    I think there is an easier way…

    Have a look at Creating_a_Static_Front_Page. Using this method, your Blog Page would use index.php and you could then apply a custom page template to your Home page using the code you’ve already developed for your featured posts.

    Thread Starter chainzor

    (@chainzor)

    Okay, so how do we work this out, do I come to where in the world you are to kneel before you and praise you, or what is the common practise?

    Really, thanks for the assistance, the neat response-time ect ect.

    I’ll consider me problems terminated. (I wonder, does that make you a ..terminator? :O)

    Ooo… terminator. I like the sound of that. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘The Loop returns bollocks on a custom template site.’ is closed to new replies.