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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현