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;








0















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;


}










share|improve this question






















  • what is stored in $faq_loop?

    – Darsh khakhkhar
    Mar 23 at 5:55











  • function turacos_faq_shortcode($atts, $content = null) 













0















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;











share|improve this question






















  • 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













share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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

















  • 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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript