Skip to main content
11 events
when toggle format what by license comment
Mar 7, 2013 at 0:10 vote accept Sal
Mar 7, 2013 at 0:02 comment added Milo without seeing the contents of that file, I can't say for certain, but you can probably just add include('sidebar-reviews_review.php'); within the while loop in place of the_title();. all the template tags will work exactly the same in this version as in your original.
Mar 6, 2013 at 23:37 comment added Sal Ah, I see how this works. However, the code I currently have allows for better customization. In that sidebar-review_reviews.php file I mentioned in my earlier post, I'm able to customize the post title, image, excerpt, etc. How do I set up this new code so I'm able to do the same? I'm basically looking for a format like the one I posted.
Mar 6, 2013 at 23:28 comment added Milo it's a complete replacement of all of the get_posts code, you would change 93, 85 in the example with your category IDs 30, 1.
Mar 6, 2013 at 22:35 comment added Sal Ah, alright. So now, and I apologize as I'm not too keen on PHP what would I replace this with: <?php global $post; $myposts = get_posts('numberposts=5&category=30'); foreach($myposts as $post) : setup_postdata($post); ?> <?php if ( in_category('1') ) { ?> <?php include('sidebar-reviews_review.php'); ?> <?php } ?> To make it pull posts from categories 30 and 1.
Mar 6, 2013 at 22:32 comment added Milo it does, category__in fetches posts that are in one category OR another, category__and fetches posts that have both categories.
Mar 6, 2013 at 22:09 comment added Sal Hmm. Perhaps I mislead. I'm trying to only get posts that are in both categories at the same time. Category__and doesn't do that, no?
Mar 6, 2013 at 21:57 comment added Milo it would replace get_posts, see edit above.
Mar 6, 2013 at 21:56 history edited Milo CC BY-SA 3.0
added 136 characters in body
Mar 6, 2013 at 21:54 comment added Sal Where would that go in a situation like this? <?php global $post; $myposts = get_posts('numberposts=5&category=1'); foreach($myposts as $post) : setup_postdata($post); ?>
Mar 6, 2013 at 21:49 history answered Milo CC BY-SA 3.0