rt49andellis
Forum Replies Created
-
Forum: Hacks
In reply to: $recent->query of cat problemThe answer is
$recent = new WP_Query( array( 'category__in' => $catID ) );
Thank you EVERYONE for helping me out!!!
Forum: Hacks
In reply to: $recent->query of cat problemI think that might actually be working correctly and it’s picking up parent/child stuff.
categories 3&4 are children of 23
category 3 is a child of 4How do I tell it to ignore parents & children?
Forum: Hacks
In reply to: $recent->query of cat problemI’m not getting that one to work either. I know I’m doing something REALLY dumb!! And now I see there are problems other than the quote problem.
single.php
<?php $i = 1; $catIDs = array("23","3","4"); foreach ($catIDs as $catID) { echo "loop #" . $i . "<br />"; listGames($catID); echo "<br />---------<br />"; $i++; } ?>
function.php
function listGames($catID) { $recent = new WP_Query(); $recent->query( "cat=$catID" ); while($recent->have_posts()) : $recent->the_post(); the_title(); echo "<br />"; endwhile; }
OR function.php (from Ron)
function listGames($catID) { $recent = new WP_Query( array( 'cat' => $catID ) ); while($recent->have_posts()) : $recent->the_post(); the_title(); echo "<br />"; endwhile; }
output
loop #1 POST FROM CAT 4 POST FROM CAT 3 POST FROM CAT 23 --------- loop #2 POST FROM CAT 3 --------- loop #3 POST FROM CAT 4 POST FROM CAT 3 ---------
Forum: Hacks
In reply to: $recent->query of cat problemThe double/single quote problem still happens even without the quotes on the $catID =
And, the code actually sets the variable elsewhere. Was hoping the cut down code might help, but it just added more confusion. Here’s the real code
function listGames($catID) { echo "catID is " . $catID . "<br/>"; // works $recent = new WP_Query(); $recent->query("cat=$catID"); while($recent->have_posts()) : $recent->the_post(); ?> .....
Forum: Plugins
In reply to: $recent->query of cat problemI apologize — This is posted in the wrong area. If someone could delete it, I’d appreciate it.
New post created at this page.
Thank you.
Forum: Fixing WordPress
In reply to: User Meta – Location, State, Country etcI apologize – I just realized that this portion of the profile was coming from a plugin, not the WP core.