Can’t get category links for posts! Ideas? (YAPB)
-
Hi! I’m developing a site that uses categories quite a lot (see https://www.fhoto.se/nytest for a test site) and I’m trying to get a new front page working with thumbnails of one post from each category.
I tagged a post in each category with ‘frontar’ and tried modifying the YAPB mosaic code found here: https://johannes.jarolim.com/blog/2008/07/24/your-own-photo-mosaic-page-with-wordpress-and-yapb/
into this:
<?php if (have_posts()): while (have_posts()): the_post(); ?> <?php global $post; ?> <?php $photoblog_posts = get_posts('tag=frontar'); $thumbConfig = array( 'h=167', 'q=100', 'fltr[]=usm|60|0.5|0' ); ?> <?php foreach($photoblog_posts as $photoblog_post): ?> <?php if (!is_null($image = YapbImage::getInstanceFromDb($photoblog_post->ID))): ?> <div class="menyelement"><a href="<?php echo get_category_link();?>"><img src="<?php echo $image->getThumbnailHref($thumbConfig) ?>" width="<?php echo $image->getThumbnailWidth($thumbConfig) ?>" height="<?php echo $image->getThumbnailHeight($thumbConfig) ?>"/></a><br /><span class="menycat"><?php the_category(); ?></span></div> <?php endif ?> <?php endforeach ?> <?php endwhile; endif; ?>
But as you can see here: https://fhoto.se/nytest/?page_id=300 I don’t get the right category info. Any ideas? Any help will be much appreciated! Thanks!
Fred
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Can’t get category links for posts! Ideas? (YAPB)’ is closed to new replies.