• Resolved lexavision

    (@lexavision)


    In order to get proper paging I put the following in my index.php:
    <?php query_posts($query_string.’cat=3,5, 6&posts_per_page=15′); ?>

    The problem is that when I try to view each post I get “Sorry, but no posts matched your criteria”

    I think the categories are getting screwed up. The posts display fine in the admin viewer.

    Please help?

Viewing 9 replies - 1 through 9 (of 9 total)
  • What do you mean by “in order to get proper paging”? Maybe there’s another way around the problem?

    Thread Starter lexavision

    (@lexavision)

    Hi esmi,

    I have 30 posts. I want to dispaly at most 15 on teach page so the page is not so big. Setting the “Blog pages show at most” to 15 doesn’t work as I’m getting dupicate posts.

    Using: <?php query_posts($query_string.’cat=3,5, 6&posts_per_page=15′); ?>

    Seems to solve that issue, but the side affect is that when you click on the posts I get the “Sorry, but no posts matched your criteria”
    message for all posts.

    Setting the “Blog pages show at most” to 15 doesn’t work

    I’d suggest figuring out why it doesn’t work. Do you have an older copy of the template file that doesn’t use your query_posts fix?

    Thread Starter lexavision

    (@lexavision)

    No. Setting the “Blog pages show at most” to 15 doesn’t work.

    It shows posts that are not in chronological order and duplicate posts.

    Thus, I’m forced to use the <?php query_posts($query_string.’cat=3,5, 6&posts_per_page=15′); ?> code in my index file.

    Do you have an older copy of the template file that doesn’t use your query_posts fix?

    No. This is my first attempt at trying to break my page out into multiple pages.

    Thread Starter lexavision

    (@lexavision)

    I cuurently have my permalinks set to Month and name.

    When I change to default (ID’s) the posts work fine. However this breaks my static pages and I don’t want to use ugly permalinks.

    Thread Starter lexavision

    (@lexavision)

    Moderator?

    Can I escalate this?

    No. Setting the “Blog pages show at most” to 15 doesn’t work.

    The point is that it should work. Which means that something in your particular setup is stopping it from working. Could be in your theme. Could be a plugin. But you have some sort of conflict somewhere. In that situation, any solution you try is going to be hit and miss.

    When I change to default (ID’s) the posts work fine. However this breaks my static pages and I don’t want to use ugly permalinks.

    How does it break your static pages? That shouldn’t happen – which emphasises that point that there’s something screwy going on. If the root cause is identified and fixed, you’ll be able to have pretty and functional permalinks.

    And there is no escalation process here. It’s a user’s forum. That means users helping out other users voluntarily. No paid support. No second line.

    Thread Starter lexavision

    (@lexavision)

    By “Can I escalate this?” I mean can this be put into the advanced forum?

    Apparently, I’m the only one with this issue.

    I have since pinged a few WordPress experts for consultation services.

    I certainly appreciate your response.

    Thread Starter lexavision

    (@lexavision)

    Well,

    I hired a consultant to fix this. She very good and affordable.

    Here the solution:

    Basically, WordPress looks for certain templates in a cascading fashion,
    meaning that when there’s a request for one kind of page, like a single post
    page, it first looks for a single.php template page to use to display the
    single post, and in the absence of it, it uses the index.php page.
    This allows a WordPress template developer to customize their templates with
    template files that specifically address certain types of pages and
    requests. When you tried to modify the query code, the code that pulls the
    posts, you were doing it right, BUT, when WordPress went to display a single
    post, it looked to that index.php template file he edited. Since it was
    edited with a new query, the single post wasn’t being displayed.
    By adding a single.php file, without the modified query, it worked as it
    should.

    The query_posts was also modified in the index.php

    <?php query_posts(array(‘cat’ => ‘3,5,6,7’, ‘posts_per_page’ => 15, ‘paged’ => $paged)); ?>

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Getting Sorry, but no posts matched your criteria’ is closed to new replies.