• Resolved esferapublica

    (@esferapublica)


    Hey,

    I’m having a category page, where I see the last six entries of the category. On the end of the category page I would like to have a link like ?Show all? that shows all entries of this category in my search template.

    How can I solve this??

    I tried to put the category ID (7) in the URL (https://www.mydomain.com/blog/?s=7, but that was obviously wrong. He just was searching for the number ?7?. Please! Could anybody help?

    Would be nice to get any response. Thx.
    Ka

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter esferapublica

    (@esferapublica)

    hello nsathees,

    thanks, for your reply. but with this template tag i just get a list of my categories. I need one link (in this case: ?show all?) to all posts from one category in my search result template. actually like a search, just without the search field and the submit button. just the link.

    sorry, if this is confusing. i try to make it as clear as possible. :/

    Thread Starter esferapublica

    (@esferapublica)

    thats actually how i create the link until now, but – as i wrote – it’s wrong, because he doesn’t give me the search results for everything in category 7, he just is searching for the nr. ?7?.

    <a href="https://www.mydomain.com/blog/?s=<?php $category = get_the_category(); echo $category[0]->category_parent; ?>">
    	show all
    </a>
    Thread Starter esferapublica

    (@esferapublica)

    problem solved:

    to give me all posts from one category as a search result i just have to create the link with

    <a href="https://mydomain.com/blog/?s=+&cat=
       <?php $category = get_the_category();
       echo $category[0]->cat_ID;
       ?>">
    	thats my link
     </a>

    My result was this right link:
    https://mydomain.com/blog/?s=+&cat=7

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘whole category as search result’ is closed to new replies.