I create a module for elementor. I need to display the author name, choosen from the elementor admin control. I have 4 administrator. They show up correctly on control panel: admin (ID=0.) Jhon Doe (ID=1.) Jeane Doe (ID=3.) Mary Doe (ID=5.) The code for Elementor admin panel: When I choose Jeane Doe from Elementor control admin, the output on the
Tag: loops
php loop show current year data if not found instead of skiping
So I have a loop within a loop both have year data and I’m trying to figure out how to show current year (2021) data if years don’t match or exist on loop instead of using continue to skip the entry, any ideas or solutions are appreciated. LIVE CODE: http://sandbox.onlinephpfunctions.com/code/b7cbef0613636aa41a41a7d5f283a2569ece9cb0 So this is the OUTPUT I get: And this is
Attempting something new in WP. Issue resetting WP loop
Im working in WP and basically what I’ve got set up is some logic to create a separate carousel for each category of my blog. For each carousel im displaying the top viewed posts for each category. Each Item in the carousel has a post thumbnail, author name and author avatar. My problem(if you scroll down to the bottom of
PHP – Loop through UNION ALL query and add custom text once after the last item per category
I have a union query which joins several categories. I want to include the link after the last item of the category. The query goes like: … the result is The output should be like this: Here is the loop thanks to user @Luuk, but now I would like to include a link after the last item from the category.
PHP display while loop data accurately in SMARTY template
In the following code when I try to assign $viewAd value to the template file and display result it does not display the accurate results when assigned to the template. However, it displays the accurate desired result on top of the page when I straight echo the $viewAd in the PHP page. I have given the screenshots below. My PHP
PHP exceeding memory allocation in nested loops
I am parsing a string. If it meets a certain criteria, I want to append the new character to another substring until it stops meeting that criteria, and / or the end of the string. The code is basically as follows: The error that follows is: PHP message: PHP Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to
Php, new keys and values added inside loop dissapear outside loop
For a school assignment I’m trying to split stockitems with product details like colour and size in the title into groups of stockitems with different variants. I’ve got as far as having them all …
How to use a for loop to insert multiple records in a database table
I have simplified my problem into the following code: I am trying to get 10 records in the table, with each incrementing by one in the ‘x’ field. However, all I see is: Please advise. Thank you. Answer Here is how you can do that.
How to get array from list
I have a problem for my program. This my script: and this is my result result page I want to replace the words “count” with the sum of each column in the same row. and my question, how I can add all column in one rows. example : row 1 = 1 + 0.5 + 0,33 + 0.25 = 2,08
Add and wrap product categories WordPress/Woocommerce in product loop
I use this snippet for display product categories in product loop on Shop and archives pages: I want this: To achieve this I use jQuery: How can I modify my PHP snippet to avoid using jQuery? Answer You could just append the corresponding tag before & after your foreach loop: Then you don’t need to custom jQuery code to wrap