• Resolved m.mujgos

    (@mmujgos)


    I was looking for this days. Cant find how to do it in WP.

    I want – in short – the funcionality of COUNTRY SELECT FORM on groupon.com.

    Which mean, when i set once a type of posts what I want to show, then it will show only POSTS. And the parametr WILL STAY until i will change it again.

    My idea was to solve it like posts will have classic categories, and tags will be COUNTRIES. When I set country(tag), and I will browse categories, it will show just posts with category&tag match. Problem is, that tag dont stay “checked” and I also cant mix it in URL(which would solve it).

    Any idea, or better solution how to make this?

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • I’m not sure but it sounds like you want to display posts which have a common tag, and are in one category? Is it for a search or to display on a page or as a list?

    Thread Starter m.mujgos

    (@mmujgos)

    Could be this way.. But I am not sure if I can do this:

    1. I will choose country
    https://www.url.com/tag1/
    2. I will click on category
    https://www.url.com/tag1/category1
    3. I will click on other category (see? tag dont change)
    https://www.url.com/tag1/category2

    And also I dont know if there is way to filter by category and tag at the same time.

    __________________________________________

    Maybe better explanation is to imagine it like a multilanguage site. You click another language
    https://www.url.com/en/category1
    Categories are still same, but showing something different. Language dont change until you do it again.
    https://www.url.com/fr/category1

    code which filters category and tag:
    code

    Thread Starter m.mujgos

    (@mmujgos)

    Thanks that will help. But additional a find out that solution what i was looking for was using sessions. (with filtering tags u send me.

    if (isset($_GET[‘variable’])) {
    $some_variable= $_GET[‘variable’];
    $_SESSION[‘variable’] = $some_variable;
    }

    with use of form, sending GET.

    deepbevel

    (@deepbevel)

    I don’t think I follow, but I’m glad if it helped.

    I have been searching for a solution to this for days, I want to achieve this on my website. But I haven’t quite followed. Where does this code go?

    Please help! Thank you.

    I’m not sure I was ever 100% on the goal. Do you just want to filter by both category and tag?

    Yeah – I need countries and then types (like deals, offers)…

    the code I posted gets all tags in a selected category, without duplicates. It would have to be modded to grab a specific tag or tags. I wouldn’t expect it to be too difficult but my php has gone from bad to worse, out of practice. I’ll post if I have a chance to play with it.

    looks like I may have another excuse to slack on coding.
    check this out

    codewise, what you need should be much simpler than what my previous code does:

    <?php query_posts( 'category=10&tag=deals' );
    while ( have_posts() ) : the_post();
    	echo '<li>';
    	the_title();
    	echo '</li>';
    endwhile;
    wp_reset_query();
    ?>

    Of course you can change the_title to the_excerpt or the_content.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Tag and Category in one URL (Groupon country select form)’ is closed to new replies.