• Resolved goldmember

    (@goldmember)


    on this page, it’s a regular wordpress page (not archive.php or category.php or anything like that).

    in the page, I have the following php code (http://pastebin.com/bSDMGEx1) which should pull in the 5 most recent posts, plus, it should an “Older Entries” link at the bottom to early entries.

    1. for some reason the “Older Entries” link is not appearing. how come?

    2. also, i’d like the post date to appear right below the title. any idea how i do that?

    please advise. thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • can you paste the full code of that template?

    Thread Starter goldmember

    (@goldmember)

    of what template page? it’s just the standard TwentyTen theme with some CSS edits.

    from reading your question:

    in the page, I have the following php code (http://pastebin.com/bSDMGEx1) which should pull in the 5 most recent posts, plus, it should an “Older Entries” link at the bottom to early entries.

    i was assuming you were working with a page template, as in http://codex.wordpress.org/Pages#Page_Templates

    it is difficult to check what might not be working from just a few lines which are only a small part of the code.

    Thread Starter goldmember

    (@goldmember)

    no, i’m not using any sort of page template. it’s just a regular ol’ wordpress page. however, i forgot to mention that i PHP Execution plugin at work here which allows me to place PHP inside a normal page and have it work: http://wordpress.org/extend/plugins/php-execution-plugin/

    please advise.

    Thread Starter goldmember

    (@goldmember)

    well NOW i am using a custom page template, as per instructions someone gave me on another forum. i created a template called page-store-news.php which contains this code: http://pastebin.com/90mWaFH4

    Then inside of the Store News page editor, I have this:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') :1;
    query_posts( array (
          'posts_per_page' => 5,
          'cat' => '1',
          'paged' => $paged,
     ));
    get_the_date();
    previous_posts_link('« Older Entries', 5);
    ?>

    still though, I’d like to get the Post Date to appear right below each post title. How do I do that?

    when you are using a page tempalte, the content from the page editor will usually be irrellevant, and will not be shown;

    to add the date below the post title, you would need to edit loop.php (which is called by the page template) and add the_date() there.

    if loop.php is used in other parts of your site (without the date), you might need to create a new loop-new.php (as a copy of loop.php) and add the date there; also you need to change this line (27) in your page template to:

    get_template_part( 'loop', 'new' );

    Thread Starter goldmember

    (@goldmember)

    oy yoy yoy.

    is there a simpler way (not custom page templates) to accomplish what I originally set out to do?

    i used to be able to just paste php code in the page editor, but apparently after one of the recent WP upgrades, that trick no longer works.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘wp_query code not creating Previous Entries link’ is closed to new replies.