Questions tagged [loop]
The core of the WordPress query, the loop offers an easy way to access post information and display it on your website.
3,326 questions
0votes
0answers
31views
How can I efficiently process 50k+ Gravity Forms entries without running into memory or timeout issues?
I'm working on a WordPress shortcode that aggregates data from Gravity Forms entries. I have: Around 50,000 entries on an enrollment form Around 30,000 entries on a feedback form Over 200 trainings I ...
0votes
0answers
24views
How to adjust meta value to UTC time in WP Query
I'm displaying three lists of events on my site: past events, current events, and future events. The lists are sorted by a custom date time field. The code I have is currently working, but Wordpress ...
0votes
0answers
40views
Need help with Query Loop. Need to get current taxonomy term and its posts and group them by a different selected taxonomy term
Example: Treatment - (Term of resource_type Taxonomy) Resource Name 1 (term of resource_name Taxonomy) Resource 1 - Post 1 Resource 1 - Post 2 Resource Name 2 (term of resource_name Taxonomy) ...
0votes
0answers
34views
WPFacet multiple loop displaying duplicate content
I have created multiple loop or wpfacet lisiting for featured job(taxonomy) and for main loop which displays job on the basis of location, but https://facetwp.com/help-center/faq/can-i-use-multiple-...
1vote
0answers
58views
Shortcode in loop always display data of first post on the page
I am creating a shortcode to fetch the categories of a given post and display them in a stylish way. I made the following shortcode: function t3_categories_fonction(){ global $post; // Get the ...
0votes
0answers
19views
Run a query for loop ordering by the sum of the inverse of comment age with WP_Query
I need some help creating a specific WordPress query and I am drawing a blank on how to do it. I want to select n posts ordered by the sum of the inverse of the age in days of the comments. I'd like ...
0votes
1answer
13views
Different number of posts in regular loop and CPT category page
I have a few custom post types with custom categories – and i also use the regular posts page for news. At the moment i can only change the number of posts through Settings > Reading > Number of ...
0votes
1answer
30views
When a foreach loop is used multiple times in blocks, is there a way to ensure a variable always has a unique value?
I'm a bit new to this so sorry if my explanations are a bit daft. We use custom gutenberg blocks on our site. One of them is a FAQ block where you can add questions/answers and they display as an ...
0votes
1answer
17views
How could I prevent using the same custom loop in a template file when I only need to change one meta_query parameter?
I am displaying a set of upcoming fixtures for two cricket teams on the same page. The fixtures are created from a CPT and the relevant team is selected from a custom field. I have everything working ...
0votes
1answer
21views
Custom theme on multisite has issues with standard loop output
I am experiencing the following error output when using the standard loop on page.php and single.php on a multisite-based WordPress installation. The loops are the same for both template types, with ...
1vote
0answers
20views
Dinamis Query Loop template Custom Post Type dan Taxonomy di WordPress Blocks dengan PHP
Google Translated: Hello everyone, I’m trying to create custom blocks in WordPress that dynamically display posts from custom post type that I’m creating, which is “products”. I also want to sift the ...
0votes
0answers
24views
Wordpress Post Query Using Custom native MySQL like St_Distance_Sphere
Is there a way to query posts for "the loop". But include some filter on the results based on a mySQL Function like St_Distance_Sphere? Or convert a wpdb->query into a form similar to &...
0votes
1answer
58views
How to get the post title inside a custom block in a loop? block.js
I have created a custom post type and I want to create blocks that display its values. To start with, I created a placeholder that gets replaced with the correct values using PHP. Everything works as ...
1vote
0answers
11views
Inside nested wordpress loop (post & post-type) " in_array()" function can't retrieve the matching value
I want to display the logo of a metadata from post-type for all post matching same name/category. Posts-type: are Activities (sport). Posts: are News from these activities Inside my first loop I get ...
0votes
0answers
13views
show title and displaying link gallery
I'm looking to show a gallery list ( 1 pic + title of gallery + link to gallery) on one page. I have catch id galleries... it's good for the first line. I've Pic + title + link But for the second... ...