Need some help with query_posts (2 posts)

  1. Chris
    Posted 7 years ago #


    I made some plugin that i can search for the first letter and also in a category or not.

    this works great, its like a form with all A-Z buttons and a dropdown list for the cats.

    like i said this works great, but when i am getting the search displayed (the plugin uses the index.php for displaying those results)
    and when i click on it to go to the single post display.
    i use the page navigation in the single posts, i loose mine query and the posts are ordered like on the frontpage (not the layout)

    so when i search for "battle" in the cat "Action" i get like 17 results shown, i like to see those results back in mine single pages and not all of mine posts.

    so i guess single breaks the query and shows them all

    dunno how to solve it?

    i use this on mine index.php
    but this worls only for the multiple posts display. need some guidance how to do it in a single post view so i can navigate from the single view thru mine results.

    /* Letter Index  */
            if (isset($_GET['category_parent'])) {
                $addcatid = $_GET['category_parent'];
                                                  } else {
                                                  $addcatnaam = single_cat_title('', false);
                                                  $addcatid = get_cat_id($addcatnaam);
    if (isset($_GET['letter'])) {
    $letter = $_GET['letter'];
    add_filter('posts_where', "custom_post_where");
    $posts = query_posts($query_string . '&cat='.$addcatid.'&orderby=title&order=asc&posts_per_page=13');
  2. Chris
    Posted 7 years ago #

    sorry example page: http://adult-links.info/
    p.s. no its not a #$@# page .. just an unluckly choosen name. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic