• Resolved ptryk

    (@ptryk)


    i am trying to create an index with some “other” page excerpted followed by posts; the page and the posts are seperated by different styles / containers

    i have had some trouble getting it going, have used as reference
    http://codex.wordpress.org/the_loop & also found http://wordpress.org/support/topic/28770

    but still i have been unable to get it to go.. now i am unable to restart the loop.. and can only get the page “abc123” .. i have had a hankering there is an easier way, but have been unable to find it.. so now i am doing..

    <cod>
    <div id=”leftside”>
    <div id=”content”>
    <?php $posts = @$wpdb->get_results(“SELECT * FROM $wpdb->posts WHERE post_title=’abc123′ ORDER BY post_date DESC”);if($posts) : foreach($posts as $post) : start_wp();?>

    <h1><?php the_title(); ?></h1>
    <?php the_excerpt(); ?>

    <?php endforeach; endif; ?>
    <?php rewind_posts(); ?>
    </div>
    </div>

    <div id=”leftsidebot”>
    <div id=”content”>
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <h3><?php the_time() ?></h3>
    // with much more then
    <?php endforeach; endif: ?>
    </div>
    </div>

    i would really appreciate your help on this

Viewing 4 replies - 1 through 4 (of 4 total)
  • What’s the second Loop supposed to do? Which Posts should show up there?

    Thread Starter ptryk

    (@ptryk)

    sorry… i left out the middle and replaced it with
    “// with much more then”

    for the moment it is only a slightly rearranged “standard” ( kubrick theme) loop to get the “posts”, nothing so strange about it, with clean closed tags… http://codex.wordpress.org/The_Loop

    but to answer your question.. basically, in its full form outputs posts according to the settings set at wp-admin that it seems within wordpress the index.php should show posts and the page.php should show a returned page (since it is basically the same exact code to pull out pages.. i am trying to combine the two.. but in reverse a page loop then a post loop?

    Thread Starter ptryk

    (@ptryk)

    figured it out.. after taking some time away came back to it and with the thought that a solution had to be easier than what i was doing.. in fact.. turned out it was easy-peasy-lemon-squeesy…

    some days are good .. some days are bad .. some days are confused

    anyhow, for anyone who somehow searches and finds their way here..


    <div id="leftside">
    <div id="content">
    <?php
    if(is_home()) : get_a_post('intro'); ?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
    //and more stuff if one would like
    <?php endif; ?>
    <?php query_posts </div>
    </div>
    <div id="leftsidebot">
    <div id="content">
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    //misc stuff to export posts as you would like
    <?php endif; ?>
    </div>
    </div>

    “welcome” is the page with the .. err.. ‘welcome message’ that shows up at the top.. and only on the index page.. without the use of special templates it will not show up on pages using the index.php unless it is ‘home’.

    thats it.

    Thread Starter ptryk

    (@ptryk)

    jeez.. wheeew… i am spac’n today..
    not “welcome” but.. “intro” and no open query thingy .. see here instead>


    <div id="leftside">
    <div id="content">
    <?php
    if(is_home()) : get_a_post('intro'); ?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(); ?>
    //and more stuff if one would like
    <?php endif; ?>
    </div>
    </div>
    <div id="leftsidebot">
    <div id="content">
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    //misc stuff to export posts as you would like
    <?php endif; ?>
    </div>
    </div>

    -sorry

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘index with “other” page excerpt followed by posts’ is closed to new replies.