Skip to main content
Commonmark migration
Source Link

I have onnly VERY LIMITED knowledge in programming and coding.

On our website (travel agency) we offer different sample-trips sorted by regions (Mexico, Middle-America, Southamerica and other countries), see here: [Neue Welt Reisen/trips][1]Neue Welt Reisen/trips

When you select a trip e.g. [Costa Rica][2]Costa Rica you will find other sample trips at the bottom of the page. These trips should be selected from the same region, in this case Middle-America and not from the 3 other regions. There is a script that should this, but the results are only trips from the region Mexico. So my question is: How do I select the example-trips from the same region? Here is the code:

<div class="promo-trips-container">
    <?php
    $args = array(
        'post_type'     => 'ausfluge',
        'showposts'     => 3,
        'orderby'       => 'rand',
        'tax_query'     => array(
            array(
                'taxonomy' => 'reisezweck',
                'field'    => 'slug',
                'terms'    => array( 'mexiko', 'middle-america', 'south-america', 'other' ),
            ),
        ),
    );
    $trips_list = new WP_Query( $args );
    ?>

THANK YOU

Paul [1]: https://neue-welt-reisen.de/reiserouten/ [2]: https://neue-welt-reisen.de/reiserouten/costa-rica-mietwagenreise/

I have onnly VERY LIMITED knowledge in programming and coding.

On our website (travel agency) we offer different sample-trips sorted by regions (Mexico, Middle-America, Southamerica and other countries), see here: [Neue Welt Reisen/trips][1]

When you select a trip e.g. [Costa Rica][2] you will find other sample trips at the bottom of the page. These trips should be selected from the same region, in this case Middle-America and not from the 3 other regions. There is a script that should this, but the results are only trips from the region Mexico. So my question is: How do I select the example-trips from the same region? Here is the code:

<div class="promo-trips-container">
    <?php
    $args = array(
        'post_type'     => 'ausfluge',
        'showposts'     => 3,
        'orderby'       => 'rand',
        'tax_query'     => array(
            array(
                'taxonomy' => 'reisezweck',
                'field'    => 'slug',
                'terms'    => array( 'mexiko', 'middle-america', 'south-america', 'other' ),
            ),
        ),
    );
    $trips_list = new WP_Query( $args );
    ?>

THANK YOU

Paul [1]: https://neue-welt-reisen.de/reiserouten/ [2]: https://neue-welt-reisen.de/reiserouten/costa-rica-mietwagenreise/

I have onnly VERY LIMITED knowledge in programming and coding.

On our website (travel agency) we offer different sample-trips sorted by regions (Mexico, Middle-America, Southamerica and other countries), see here: Neue Welt Reisen/trips

When you select a trip e.g. Costa Rica you will find other sample trips at the bottom of the page. These trips should be selected from the same region, in this case Middle-America and not from the 3 other regions. There is a script that should this, but the results are only trips from the region Mexico. So my question is: How do I select the example-trips from the same region? Here is the code:

<div class="promo-trips-container">
    <?php
    $args = array(
        'post_type'     => 'ausfluge',
        'showposts'     => 3,
        'orderby'       => 'rand',
        'tax_query'     => array(
            array(
                'taxonomy' => 'reisezweck',
                'field'    => 'slug',
                'terms'    => array( 'mexiko', 'middle-america', 'south-america', 'other' ),
            ),
        ),
    );
    $trips_list = new WP_Query( $args );
    ?>

THANK YOU

Paul

Source Link

taxquery taxonomy get terms

I have onnly VERY LIMITED knowledge in programming and coding.

On our website (travel agency) we offer different sample-trips sorted by regions (Mexico, Middle-America, Southamerica and other countries), see here: [Neue Welt Reisen/trips][1]

When you select a trip e.g. [Costa Rica][2] you will find other sample trips at the bottom of the page. These trips should be selected from the same region, in this case Middle-America and not from the 3 other regions. There is a script that should this, but the results are only trips from the region Mexico. So my question is: How do I select the example-trips from the same region? Here is the code:

<div class="promo-trips-container">
    <?php
    $args = array(
        'post_type'     => 'ausfluge',
        'showposts'     => 3,
        'orderby'       => 'rand',
        'tax_query'     => array(
            array(
                'taxonomy' => 'reisezweck',
                'field'    => 'slug',
                'terms'    => array( 'mexiko', 'middle-america', 'south-america', 'other' ),
            ),
        ),
    );
    $trips_list = new WP_Query( $args );
    ?>

THANK YOU

Paul [1]: https://neue-welt-reisen.de/reiserouten/ [2]: https://neue-welt-reisen.de/reiserouten/costa-rica-mietwagenreise/