• Hi, im havin a rough time gettin this to work and I’d really appreciate it if someone could spot where my code is wrong, ive got a deadline coming up and this is my last hurdle. Thanks in advance for your help.. its MUCH appreciated. I’m using 1.3a4 and am aware of using alphas, and if this is possible using 1.2 (which im running on another site) using an alternate method that would be just fine also…
    I have created a page that I want to display on a different index.php
    and I dont want it showing up on the main wp index at all.
    here is my setup:
    I have a directory called “features” in this directory is my wordpress folder(“wp”)
    and another folder “01” that has the index.php I want to display my page on.
    I have setup my permalinks like so: %postname%
    my page link looks like this:
    http://mysite.com/features/wp/this-is-mypage/
    now, on the index.php in the 01 folder I have put this code at the top:
    <?php
    /* Don't remove this line. */
    $blog = 1;
    if (!isset($p)) {
    $p = "this-is-mypage";
    }
    require('../wp/wp-blog-header.php');
    ?>

    In the div that I want the entry displayed in I have this:
    <div id="contentfeat">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_date('','<h2 class="dateicon">','</h2>'); ?>
    <div class="post">
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">
    the_permalink() ?>" rel="bookmark"><?php the_title(); ?></h3>
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',')
    ?> | <img src="graphics/author.png" width="11" height="10" border="0"
    alt="" /> <?php the_author_firstname() ?> @ <?php the_time() ?> <?php
    edit_post_link(__('Edit This')); ?></div>
    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    </div>
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'),
    __('Comments (%)')); ?>
    </div>
    </div>
    <?php comments_template(); // Get wp-comments.php template ?>
    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>
    <?php posts_nav_link(' — ', __('&amp;laquo; Previous Page'),
    __('Next Page &amp;raquo;')); ?>
    </div>

    —now when I view the page I get the “Sorry no posts matched your criteria” .
    this has had me stumped for a few days now and ive been going over every forum post I can find (actually where I got the top portion of code that I modified, which might be whats borked) and the wiki and all over google and havent been able to recognize what to do to fix it, I’m much more versed in xhtml and css than I am php…
    thanks for you time and help…..
    løk

Viewing 2 replies - 1 through 2 (of 2 total)
  • $p should be a numeric post id. If you want to use the nicename, use $pagename instead.
    $pagename = "this-is-mypage";

    Thread Starter lokjah

    (@lokjah)

    rboren..
    YOU ROCK…. thanks so much for that..
    Ive got a bit of a problem now with the comments on that page.. is there a way to get comments to function on that index that I have the page on? If i click the comment link at the bottom of the entry it takes me to the wp index. the comment link is formatted like so:
    http://mysite.com/features/wp/this-is-mypage/#comments
    when you click on it, it takes you to the wp index, (and it also doesnt display the comment post form just the comments(0) link)
    rather than giving you the comment post form under the page on the index I have it on: ie http://mysite.com/features/01/index.php
    Ive tried setting the blog address in wp to:
    http://mysite.com/features/01
    which then makes my comment link on the page to:
    http://mysite.com/features/01/this-is-mypage/#comments
    and that when clicked returns a 404…
    the closest ive come to getting the comments to work is to make my “page” into a regular wp entry and then setting the variable at the top of my 01 index to:
    <?php
    /* Don't remove this line. */
    $blog = 1;
    if (!isset($p)) {
    $p = "4";
    }
    require('../wp/wp-blog-header.php');
    ?>

    which puts the comment post form under the entry, but once you hit “say it” you are brought away from my 01 directory index and over to the wp one again:
    http://mysite.com/features/wp/this-is-mypage
    am I missing something simple?
    thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need to display a page on a diff index’ is closed to new replies.