How to fix ' Invalid argument supplied for foreach()' in WordPressHow do you get the index of the current iteration of a foreach loop?How to find the foreach indexHow to determine the first and last iteration in a foreach loop?Invalid argument supplied for foreach()How does PHP 'foreach' actually work?PHP foreach invalid argument suppliedHow to break out of a foreach-loop when all filtered objects have been deleted?Wordpress Foreach, Pass Category ID variable to Display Posts?How to get the id of each object from a php foreach loop?Upgrade to Wordpress 4.6.1 and now “Warning: Invalid argument supplied for foreach() ”
why it is 2>&1 and not 2>>&1 to append to a log file
Convert a huge txt-file into a dataset
Why doesn't increasing the temperature of something like wood or paper set them on fire?
Employee is self-centered and affects the team negatively
What's weird about Proto-Indo-European Stops?
call() a function within its own context
Did any early RISC OS precursor run on the BBC Micro?
Why is the blank symbol not considered part of the input alphabet of a Turing machine?
How can I test a shell script in a "safe environment" to avoid harm to my computer?
Extracting the parent, leaf, and extension from a valid path
What’s the interaction between darkvision and the Eagle Aspect of the beast, if you have Darkvision past 100 feet?
A problem with Hebrew and English underlined text
Can anyone identify this unknown 1988 PC card from The Palantir Corporation?
HTML folder located within IOS Image file?
Explaining intravenous drug abuse to a small child
Is there a reason why Turkey took the Balkan territories of the Ottoman Empire, instead of Greece or another of the Balkan states?
Gift for mentor after his thesis defense?
What calendar would the Saturn nation use?
What's the 2-minute timer on mobile Deutsche Bahn tickets?
An adjective or a noun to describe a very small apartment / house etc
Crime rates in a post-scarcity economy
Why is the episode called "The Last of the Starks"?
Scaling rounded rectangles in Illustrator
Why doesn't a particle exert force on itself?
How to fix ' Invalid argument supplied for foreach()' in WordPress
How do you get the index of the current iteration of a foreach loop?How to find the foreach indexHow to determine the first and last iteration in a foreach loop?Invalid argument supplied for foreach()How does PHP 'foreach' actually work?PHP foreach invalid argument suppliedHow to break out of a foreach-loop when all filtered objects have been deleted?Wordpress Foreach, Pass Category ID variable to Display Posts?How to get the id of each object from a php foreach loop?Upgrade to Wordpress 4.6.1 and now “Warning: Invalid argument supplied for foreach() ”
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I use foreach loop on WPBekary shortcode but it showing an error message.
Here is my shortcode:
$turacos_faq_markup ='
<div class="faq">
<ul class="accordion">';
$faq_loop = vc_param_group_parse_atts($all_faq);
foreach($faq_loop as $faq)
$turacos_faq_markup .='
<li class="accordion-item">
<a class="accordion-title" href="javascript:void(0)">'.esc_html($faq['title']).'</a>
<p class="accordion-content" style="display: none;">'.esc_html($faq['desc']).'</p>
</li>';
$turacos_faq_markup .='
</ul>
</div>';
return $turacos_faq_markup;
}
wordpress foreach
I use foreach loop on WPBekary shortcode but it showing an error message.
Here is my shortcode:
$turacos_faq_markup ='
<div class="faq">
<ul class="accordion">';
$faq_loop = vc_param_group_parse_atts($all_faq);
foreach($faq_loop as $faq)
$turacos_faq_markup .='
<li class="accordion-item">
<a class="accordion-title" href="javascript:void(0)">'.esc_html($faq['title']).'</a>
<p class="accordion-content" style="display: none;">'.esc_html($faq['desc']).'</p>
</li>';
$turacos_faq_markup .='
</ul>
</div>';
return $turacos_faq_markup;
wordpress foreach
what is stored in $faq_loop?
– Darsh khakhkhar
Mar 23 at 5:55
function turacos_faq_shortcode($atts, $content = null) extract( shortcode_atts( array( 'all_faq' =>'', 'title' => '', 'desc' => '', ), $atts) );
– Sakib Hasan
Mar 23 at 6:40
you are passing $faq_loop to the foreach it must be an array.
– Darsh khakhkhar
Mar 23 at 6:51
add a comment
wordpress foreach
I use foreach loop on WPBekary shortcode but it showing an error message.
Here is my shortcode:
$turacos_faq_markup ='
<div class="faq">
<ul class="accordion">';
$faq_loop = vc_param_group_parse_atts($all_faq);
foreach($faq_loop as $faq)
$turacos_faq_markup .='
<li class="accordion-item">
<a class="accordion-title" href="javascript:void(0)">'.esc_html($faq['title']).'</a>
<p class="accordion-content" style="display: none;">'.esc_html($faq['desc']).'</p>
</li>';
$turacos_faq_markup .='
</ul>
</div>';
return $turacos_faq_markup;
}
wordpress foreach
wordpress foreach
asked Mar 23 at 5:51
Sakib HasanSakib Hasan
11
11
what is stored in $faq_loop?
– Darsh khakhkhar
Mar 23 at 5:55
function turacos_faq_shortcode($atts, $content = null){ extract( shortcode_atts( array( 'all_faq' =>'', 'title' => '', 'desc' => '', ), $atts) );
– Sakib Hasan
Mar 23 at 6:40
you are passing $faq_loop to the foreach it must be an array.
– Darsh khakhkhar
Mar 23 at 6:51
add a comment |
what is stored in $faq_loop?
– Darsh khakhkhar
Mar 23 at 5:55
function turacos_faq_shortcode($atts, $content = null){ extract( shortcode_atts( array( 'all_faq' =>'', 'title' => '', 'desc' => '', ), $atts) );
– Sakib Hasan
Mar 23 at 6:40
you are passing $faq_loop to the foreach it must be an array.
– Darsh khakhkhar
Mar 23 at 6:51
what is stored in $faq_loop?
– Darsh khakhkhar
Mar 23 at 5:55
what is stored in $faq_loop?
– Darsh khakhkhar
Mar 23 at 5:55
function turacos_faq_shortcode($atts, $content = null){ extract( shortcode_atts( array( 'all_faq' =>'', 'title' => '', 'desc' => '', ), $atts) );
– Sakib Hasan
Mar 23 at 6:40
function turacos_faq_shortcode($atts, $content = null){ extract( shortcode_atts( array( 'all_faq' =>'', 'title' => '', 'desc' => '', ), $atts) );
– Sakib Hasan
Mar 23 at 6:40
you are passing $faq_loop to the foreach it must be an array.
– Darsh khakhkhar
Mar 23 at 6:51
you are passing $faq_loop to the foreach it must be an array.
– Darsh khakhkhar
Mar 23 at 6:51
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55311025%2fhow-to-fix-invalid-argument-supplied-for-foreach-in-wordpress%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55311025%2fhow-to-fix-invalid-argument-supplied-for-foreach-in-wordpress%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
what is stored in $faq_loop?
– Darsh khakhkhar
Mar 23 at 5:55
function turacos_faq_shortcode($atts, $content = null)