wp query: custom tax queries generated by Foreach, each with an ajax "Load more" button

I'm going through custom taxonomy terms to create a WP_Query for each term, and then view the posts in the front-end.

I am also trying to adapt this useful tutorial (and the accompanying comments) to add an ajax load more button to each loop iteration. This is what I think distinguishes this problem from other publications in WP-StackExchange: add a more load button to a loop query, instead of a single query or simply multiple WP_Query encoded (not loop) on a page.

The original tutorial uses wp_localize_script to pass php data to a registered and queued jQuery script, but since I need unique variables created with each loop, it didn't seem like he could use it (and the author of the tutorial himself says not to use wp_localize_script if you use a custom WP_Query). The comments in that post also refer to the use of unique variables for multiple queries, but I couldn't resolve it for looped queries.

The button that is included in each iteration of the loop:

// don't display the button if there are not enough posts
if (  $unique_query->max_num_pages > 1 )
    echo '';

I realize that the following code is not as concise as it could be yet (hence why I am here), but I include in each foreach query & # 39; d the same jQuery to be able to create unique query vars for each loop (it is tell, . current_page_):

The jQuery included at the end of each loop iteration:

$cat_string = the current taxonomy term string, that is. los_angeles

Ajax action loadmore it's hooked on my functions.php like this:

function bos_loadmore_ajax_handler(){

    // prepare our arguments for the query
    $args = json_decode( stripslashes( $_POST('query') ), true );
    $args('paged') = $_POST('page') + 1; // we need next page to be loaded
    $args('post_status') = 'publish';

    // it is always better to use WP_Query but not here
    query_posts( $args );

    if( have_posts() ) :

        // run the loop
        while( have_posts() ): the_post();

            get_template_part( 'template-parts/event', 'small' ); 


    die; // here we exit the script and even no wp_reset_query() required!

add_action('wp_ajax_loadmore', 'bos_loadmore_ajax_handler'); // wp_ajax_{action}
add_action('wp_ajax_nopriv_loadmore', 'bos_loadmore_ajax_handler'); // wp_ajax_nopriv_{action}

Unique query vars create instances and complete correctly: I can see the correct result for each tax term cycle in the Inspector.

The "Load more" button is displayed correctly since the query has 26 posts and shows 20, but when I click on the button it changes to "Loading …" and then disappears. Of some console.logIt seems that it jumps directly to the else branch for "no data was found", so I think that the action hooked in my function file is not getting the correct query values ​​to execute the query. Does that seem correct?

However, I cannot understand how the query variables should be different to get the correct query.

And to be exhaustive, the $ args WP_Query for each loop query are:

$paged = ( get_query_var('page') ) ? get_query_var('page') : 1;
$args = array(
    'post_type'              => array( 'tribe_events' ),
    'post_status'            => array( 'publish' ),
    'posts_per_page'         => 20,
    'nopaging'               => false,
    'paged'                  => $paged,
    'tax_query'              => array(
            'taxonomy'         => 'tribe_events_cat',
            'field'            => 'name',
            'terms'            => $the_cat,

Any help is really appreciated.

Mexico – How does the Baja California Sur sustainability tax work?

When flying to the San Jose del Cabo airport, they gave me a flyer about a new sustainability tax. According to the LA Times:

Travelers arriving at Los Cabos International Airport will be asked for around $ 18 (350 pesos) each as of Saturday. But local officials say this is not a tax. It is a request for a voluntary contribution to benefit a new Fund for a Sustainable Baja California Sur.

Under the new program, authorities said, the San José del Cabo airport will have kiosks that will encourage visitors to contribute to the kiosk or through online payments.

The article then mentions that it is a voluntary tax (?):

Isidro Jordán Moyrón, secretary of finance for the State of Baja California Sur, said in a prepared statement that the new effort is not an "entry tax" and that "visitors will not be forced or unduly forced to make a contribution."

Is it really voluntary? Is there a penalty for not paying this tax?

event observer – Magento 1.9: get the tax value of the order parameters when the payment method is paypal express

In my Magento 1.9 project there is an observer to obtain the tax value of the order at the place of the previous order. But when the payment method selected is paypal express, Mage :: app () -> getRequest () -> getParams () has no taxvat field, but only payerid and token.
How can I get the tax value of the order when the payment method is Paypal Express?
Bye thank you

Magento2: show prices including TAX Magento 2.3?

Battery exchange network

The Stack Exchange network consists of 175 question and answer communities, including Stack Overflow, the largest and most reliable online community for developers to learn, share their knowledge and develop their careers.

Visit Stack Exchange

variables – Woocommerce; Tax status for product variations?

I realized that by creating a new variable product in Woocommerce and setting the tax status of the main product at & # 39; none & # 39 ;, the variations still show: & # 39; tax status: taxable & # 39; in the database. Does anyone know what determines the value of the tax status of product variations?
As in another installation, I have variable products where the main product shows & # 39; tax status: taxable & # 39; and product variations show: & # 39; tax status: none & # 39 ;. In the front-end, the tax is calculated for variations, although …

Thank you.

Where is the tax exemption located at Mariehamn airport?

I recently flew from Mariehamn to Stockholm, but I couldn't find the free tax. When reading about the airport, I discovered that it is actually exempt from the EU VAT area and that the tax exemption is tax exempt (not as in other EU airports on EU flights), even when flying to Sweden or Finland!

Where can I find the free tax at Mariehamn airport?

magento2: make the tax not mandatory in the customer registration form programmatically

I want to force the tax field as not required in the client creation form
Even if I have ovrride

vendor / magento / module-customer / view / frontend / templates / widget / taxvat.phtml

with a complement in my custom module

removing data-validate = "{required: true}"

When I submit the form, the error "Tax number / VAT" is a required value.

enter the description of the image here

WooCommerce tax filter not activated

I want to apply zero taxes when the sum is less than 100, but this code is not activated (I don't see printing on the console or the echo is the source).
I added this to the code snippet plugin. What am I doing wrong?

add_filter (& # 39; woocommerce_product_tax_class & # 39 ;, & # 39; big_apple_get_tax_class & # 39 ;, 1, 2);

function big_apple_get_tax_class ($ tax_class, $ product) {
echo "";

global $ woocommerce;
$ cart_subtotal = $ woocommerce-> cart-> get_cart_subtotal ();
if ($ cart_subtotal <= 100)
$ tax_class = & # 39; Zero rate & # 39 ;;

return $ tax_class;

Does it bother you that Trump doesn't publish his tax returns?

He promised that he would, now he will go to court to refuse.

I am not sure that it "bothers me" (apart from the deliberate lie in the first place), but I and many people are curious why he is struggling so hard to hide something he promised not to hide.

And he has no one to blame but himself.

Considering buying PC parts for my personal equipment in Hong Kong. I would like to know about the Indian import tax

  1. How will these be taxed? Do I have to pay an import fee or other taxes in my country?

  2. How should I bring those components 4-5 with me to avoid damage?

We have the total tax when importing from other countries to 42%. A one-week trip would make sense if I can get a tax exemption even on a single item like the CPU.