loop – Group the publications in a category according to the tags in the personalized taxonomy

For the query_post function, it is recommended not to use according to official documents.

This function will completely replace the main query and is not intended to be used by plugins or themes …….. It should not be used in the WordPress loop.

You can read this post to grab more ideas.

To query with multiple taxonomies, you can use the WP_Query class to create a custom query.


    // custom query with multiple taxonomy as parameter
    $args = array(
        'orderby' => 'title', 
        'order' => 'ASC', 
        'posts_per_page' => -1 
        'tax_query' => array(
            'relation' => 'AND', // at the same time meet both conditions
                'taxonomy' => 'towns', // custom tag taxonomy name
                'field'    => 'term_id',
                'terms'    => array( $tag_id ),
                'taxonomy' => 'category', // default taxonomy category name
                'field'    => 'slug',
                'terms'    => array( $slug ),

    $query = new WP_Query( $args );

    // start the wordpress loop!
    if ($query->have_posts()) :

        // Make a header for the category, only if there are posts under it
        echo '


'; while ($query->have_posts()) : $query->the_post(); get_template_part('template-parts/place-listing', 'place'); endwhile; // After looping through a nested query, this function restores the $post global to the current post in this query. // properly reset may avoid problem in most of the cases wp_reset_postdata(); endif; // done our wordpress loop. Will start again for each category } // done the foreach statement ?>

Steve, I also read your previous questions that Pieter Goosen suggests using the default loop. Since you are using query_post () with an argument. In this case, WP_Query is preferred instead for performance and stability because query_post modifies the global object $ post. I guess this part is only part of the model and not the main loop. The suggestion is based on your original code and environment. You can adjust and test according to actual needs.

Best VPS offers / publications most commented in April!

April was our highest traffic month in two years at Low End Box and Low End Talk! Many thanks to members of our community for helping to build on the momentum that started a few months ago with all of our recent improvements. We will continue our efforts to make Low End Box and Low End Talk worthy of your recurring traffic in the coming months and beyond. If you haven't read many of our improvements recently, I recommend that you check out "The State of the Low-end Box and Low-end Conversation" which covered many of the things we worked on in detail. in the back-end! We also published our first interview as part of our new Low End Box Q&A series with Dustin Cisneros, who deserves to be read. Over the next few months, we plan to publish about two dozen more interviews, so keep an eye out for them.

In April 2020, we received a number of really excellent offers and lots of feedback from existing buyers and users. Overall, in April, 241 comments were published on the 10 most commented articles, up from 162 in March, which represents an excellent increase of around 50%.

Here's a review of the 10 most commented posts on the Low End Box set in April 2020:

create 5 permanent pbn publications with DA 30+ DR 50+ TF 20+ increase the ranking of your top website for $ 5

create 5 permanent pbn publications with DA 30+ DR 50+ TF 20+ increase the ranking of your website at the top

I will do SEO Private Blog Networks to boost your ranking on Google

Using an expired website and a network of private blogs, To reinforce Your Ranking This is the SEO service you need for incredible results. Bring powerful rankings, offers great support and we take your security like our Priority # 1

Provide high quality The private blog network of high authority websites means your content is more likely to ranking high on the search engine. In turn, this means more traffic, more revenue, and more leads for your brand or company

Main Features!

  • We use high 30 Plus DA/TF DR50 +, 200 Unique Areas.
  • We can provide up to 500 unique domains All have DA30 + DR50 + TF20 +
  • On every blog submission we used 100% unique handwritten content
  • All links are permanent.
  • All are articles on the home page!
  • 100% manual work, no robot use.
  • All domains are well indexed on Google
  • Details on own report provided.


how to display the content of publications on the personalized css popup by clicking on each title in the sidebar?

I want to display post titles based on post_tag of default post_type concat with post_category of another post_type named & # 39; update & # 39; in the sidebar. And finally, when users click on each title, it opens a popup window on which it displays the current title and the content of the message that clicked. so far it works well for opening a pop-up by clicking on each title in the sidebar, but i can't handle the loop and for the loop in a way that displays the title and content associates that i click on it instead, it only displays the contents of the first title only. I know my code has a lot of extra arrays and loops. I know this may only require a minor change to the location of the popup or loop or loop, but I am new to wordpress and it seems very complex to me.

Below is the entire code. take a look please. I need to complete it for the website to function properly.

Thanks in advance.

I really appreciate what you are doing here.



Search by first letter

A B VS re E F g
V W X Yes Z
& # 39; Publish & # 39 ;, & # 39; p & # 39; => get_the_ID () )); $ id_array = array (); $ title_array = array (); $ content_array = array (); $ myArray = array (); $ myArray2 = array (); $ hero = array (); $ hero2 = array (); $ i = 0; while ($ post_cats-> have_posts ()) { $ post_cats-> the_post (); for (; $ i<=count(get_the_category()); $i++ ) { $all_cats = get_the_category(); $all_Tags = get_the_tags(); ?>

Last name; if ($ hero = $ all_cats ($ i) -> cat_name == & # 39; Subject & # 39; OU $ hero = $ all_cats ($ i) -> cat_name == & # 39; Projet & # 39; OU $ hero = $ all_cats ($ i) -> cat_name == & # 39; Uncategorized & # 39;) { echo & # 39; & # 39 ;; } other { echo $ hero = $ all_cats ($ i) -> cat_name; } ?>

Last name; $ post_tags = new WP_Query (array ( & # 39; post_type & # 39; => & # 39; update & # 39 ;, & # 39; tag & # 39; => $ hero2. & # 39; - & # 39 ;. $ myArray ($ i) )); while ($ post_tags-> have_posts ()) { $ post_tags-> the_post (); $ post_tagS = get_the_ID (); ?>
<? php array_push ($ content_array, $ hero2. & # 39; - & # 39 ;. $ myArray ($ i)); } wp_reset_postdata (); for ($ h = 0; $ h<=2; $h++) { array_push($id_array($h), $post_tagS($h)); echo $id_array($h); ?>

categories – Single WP request which displays the name of the category and the publications in this category

I am trying to create a WP request which I will put in a shortcode to display it on a page.

I only want the last 5 posts to appear for each category.

Also, for performance, I want to generate this using a single query.

I want the messages to be displayed like this:

Category 1

Message 1

Message 2

Message 3

Message 4

Message 5

Category 2

Message 1

Message 2

Message 3

Message 4

Message 5


Here is what I have so far:

$query = new WP_Query($args);   
    while ( $query->have_posts() ) { 
        $categories = get_the_category();
        $posts = get_posts();
        foreach ( $categories as $category ) {
            echo '' . $category->name . '';
            while ( $category->have_posts() ) {
                echo '
'; foreach ($posts as $post){ include('templates/post_grid.php'); } echo '
'; } } } wp_reset_postdata();

For templates/post_grid.php to generate correctly, it must be inside the loop.

ACF – Use ajax to get personalized publications without reloading the page

I installed ACF on my wordpress and would like to use ajax to get personalized articles (events) without reloading the page.

I use the following function to send parameters dynamically to display messages.
And I've created check boxes like below for users to choose the settings (cities and time).

function get_events( $query ) {
    if( is_admin() ) {
        return $query;
    if( isset($query->query_vars('post_type')) && $query->query_vars('post_type') == 'events' ) {
        if( isset($_GET('city')) ) {
            $query->set('meta_key', 'city');
            $query->set('meta_value', $_GET('city'));
        if( isset($_GET('hour')) ) {
            $query->set('meta_key', 'hour');
            $query->set('meta_value', $_GET('hour'));
    return $query;
add_action('pre_get_events', 'get_events');

Checkboxes (I repeat for each city and each hour. For the hour, name = hour)

The system works well. Except that logically, when you check a box, the page reloads automatically. You cannot therefore combine the parameters "city and time" at the same time (for example to obtain events which will take place in a city (parameter 1) in the morning (parameter 2).

So I'm trying to use ajax to do this, but I'm still not very comfortable with that. Can anyone help me?

Thanks in advance.

JoyFreak reaches over 3,000 publications

Come see us! https://www.joyfreak.com/

Best offers / most commented VPS publications in March! – Low-end box

Things are really improving at Low End Box and Low End Talk, traffic for Low End Box increasing by 35% compared to March 2019 and by 15% for Low End Talk during the same comparison of one year to another. A few weeks ago, we published the first "The State of the Low-end Box and Low-end Conversation" which detailed many of the improvements we are making to our websites and our community. If you haven't read the list yet, please take a moment to check it out!

March 2020 was a great month and we look forward to much more in April 2020 and beyond. In April, interviews, surveys, more tutorials and more and more of our standard offerings are coming. We also have a number of great offers slated for April for single slots, NVMe storage and large RAM.

A quick review of the most commented Low End Box offers in March 2020. Discover them below:

Will anyone be invited to my blog? He gets more than 200 views a day. Reference links are allowed in publications. URL – www.waystoearn.online

Guys, my blog is for those who want to make money on the internet, so if you have ideas or a website that you want to promote, then you can post articles on my blog and you can contribute to its growth.

In the future, every time I put Adsense ads on my blog, I will distribute 80% of my income to my contributors.

So guys answer this thread if you really want to contribute a little

Check out my website – www.waystoearn.online

meta-query – How to get publications by multiple meta-keys and meta-values ​​with the Rest V2 API?

I'm trying to get my messages through multiple meta_keys and meta_values. How can I accomplish this? The URL should look like this: "/ posts? Meta_key = Example & meta_value = Example2 & meta_key = Example3 & meta_value = Example4"
I have been trying to find a solution for this for quite a while now, but I have not found anything more obsolete.
I hope someone can help me.

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123