Loop wp-tiles
-
I am trying to loop wp-tiles by category for each of the different archive pages. How would i do this. I absolutely love this plugin by the way.
-
Hi hiphopruckus. I’m happy you like the plugin. In version 0.3.3 of the plugin (uploaded just now), I added a function the_wp_tiles(), which you can use in your theme files. If you put this in your category template, it will automatically show only posts in that category.
<?php if ( function_exists ( 'the_wp_tiles' ) ) the_wp_tiles(); ?>
Cheers,
MikeThanks Mike. I have a few more questions. Are you gonna to eventually make this plugin into a widget? Also, I have a new theme and am having trouble trying to get the featured image to show up. Alot of times, i have posted an image and the theme (fanwood) automatically creates a thumbnail image on hiphopruckus.com after uploading from my harddrive. ALot of times, I don’t designated an image as featured. Are you going to make it possible in the next iteration for the post-tiles plugin to find the image from a post even if it’s not featured?
Hi hiphopruckus, does the plugin not take images from posts without a featured image on your website? It should already fallback to either the first attached image, or else the first <img> tag in the post itself. If it doesn’t, do you have a demo page I can check out?
As for adding a widget to the plugin, I hadn’t considered it, but it would actually be an option for themes with wide widget areas. I’ll think about it.
Cheers,
MikeHey Mike,
Yeah, it doesn’t take the first image i post that is used as a thumbnail.
It only looks for the credentials of “featured”. How do i work around this?Also,
The reason why i needed to get a widget is because the plugin shortcode doesn’t work on my archive pages. Is there a workaround for this.Also i used wp-tiles plugin, it automatically finds the image with out looking for the featured.
Hi Hiphopruckus, I’m confused. You’re saying WP Tiles does find the image even if there’s no featured image?
Then, with your category archive pages, did the function I posted earlier not work with version 0.3.3? Does it load the wrong posts? What happens?
Mike
Yes. Wp-tiles does find the image with no featured image. Yes.
concerning the category archive pages, when i put the short code in the php side of things it just reads back the short code.
Try putting this code in your category.php, instead of the shortcode:
<?php if ( function_exists ( 'the_wp_tiles' ) ) the_wp_tiles(); ?>
Also, make sure the plugin is updated to version 0.3.3.
Ok,
How do i write an if then conditional statement for different categories.It should automatically take the current category already. If you want to add a specific category, add it to the arguments along the following lines:
<?php $the_cat_id = ID_FOR_YOUR_CATEGORY; $args = array ( 'posts_query' => array ( 'cat' => $the_cat_id ) ); the_wp_tiles ( $args ); // (untested) ?>
Mike, sorry for asking you so many questions, but i just love this plugin.
By the way,
I want to display in 3 posts across instead of 2 for which is the way the plugin is setup. How do i do this?Can I replace the_wp_tiles with post-tiles for your plugin. I’m not using Wp-tiles after finding out about post-tiles.
Hey are you ever gonna add pagination to this plugin? That would be excellent if you did.
- The topic ‘Loop wp-tiles’ is closed to new replies.