Running a loop
-
Hello,
Have if I can help traverse an array, I blocked here
I’m in a page, running a loop that gives me posts with a certain category.
What I need is to get all the ID of those posts, but separately.
This is what I have>[please read https://codex.www.ads-software.com/Forum_Welcome#Posting_Code for posting code; the code below is either unreadable or corrupted]
<? php query_posts (‘category_name = skatepark’);?>
<? php if (have_posts ()): while (have_posts ()): the_post ();?>
<? php
$ postIDSkate = get_the_ID ();
$ postIDSkateA = explode (”, $ postIDSkate);
echo $ postIDSkateA [0]
?>
<? php endwhile;?>
<? php endif;?>>>>>>>>>>>
Okay, so I printed three numbers that are the 3 ID that I have.
Now I need to cross it again to give meecho $ postIDSkateALoop [0] = first number
echo $ postIDSkateALoop [1] = second number
echo $ postIDSkateALoop [2] = Third numberWhat I can do???
Thank you so much!
- The topic ‘Running a loop’ is closed to new replies.