I'm stuck on trying to write a loop for a wordpress template. I'm wanting to use the wordpress loop to show mini snippets of blog posts. I wanted to show three items per row and every two rows, have an add show up. Could anyone help me with this?
where 23 is your category id, 2 is the number of posts to offset (assuming you would call the function with 0 before and place an ad between) and 3 would be the number of posts to show. this would save you prom copy-pasting the same code.
Thanks for the help guys. I really appreciate it. I looked at the code again and I forgot a key part. Every three items, has a "row" class wrapped around them along with an "alpha" class on the first item and an "omega" class on the third item of the row.
I'm stuck on trying to write a loop for a wordpress template. I'm wanting to use the wordpress loop to show mini snippets of blog posts. I wanted to show three items per row and every two rows, have an add show up. Could anyone help me with this?
This is what my code looks like in HTML.
Could you clarify? Are your "three items" referring to three snippets of blog posts, and what is an "add"?
I guess you could try something like this:
"><?php the_title(); ?>
EDIT: Failing with "code" markdown... Can't seeem to fix it. Check it out on codepen: http://codepen.io/joe/pen/Jcfbj
You could make a function like this in your functions.php file:
http://pastebin.com/h3G44H2a
and you would call it in your theme as:
<?php mytheme_get_posts( 23, 2, 3 ); ?>where 23 is your category id, 2 is the number of posts to offset (assuming you would call the function with 0 before and place an ad between) and 3 would be the number of posts to show. this would save you prom copy-pasting the same code.
Thanks for the help guys. I really appreciate it. I looked at the code again and I forgot a key part. Every three items, has a "row" class wrapped around them along with an "alpha" class on the first item and an "omega" class on the third item of the row.