Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter fhoto

    (@fhoto)

    and this is how it shows: https://fhoto.se/nytest/

    Thread Starter fhoto

    (@fhoto)

    ok, I’m almost there.. I managed to get the category link working, but I can’t find a way to display the category title.. any clues?

    this is the loop I’m using now (scroll far right for the category title code):

    <?php if (have_posts()): while (have_posts()): the_post(); ?>
    
    <?php 
    
      $photoblog_posts = get_posts('tag=frontar&numberposts=20' );
    
      $thumbConfig = array(
        'w=260',
        'q=100',
        'fltr[]=usm|80|0.2|0'
      );
    
    ?>
    
        <?php foreach($photoblog_posts as $photoblog_post): ?>
    
          <?php if (!is_null($image = YapbImage::getInstanceFromDb($photoblog_post->ID))): ?>
    
    <? $mypost = $photoblog_post->ID ?>
    <?php $terminfo = $wpdb->get_results("SELECT term_id
    FROM $wpdb->term_relationships, $wpdb->term_taxonomy
    WHERE object_ID = $mypost AND $wpdb->term_taxonomy.term_taxonomy_ID = $wpdb->term_relationships.term_taxonomy_ID
    ORDER BY term_ID"); ?>
    
    <?// get the first term_id and assign it to $cat?>
    <?php $termrecord = $terminfo[0]; ?>
    <?php $cat = $termrecord->term_id; ?>
    
              <div class="menyelement"><a href="<?php echo get_category_link($cat) ?>"><img src="<?php echo $image->getThumbnailHref($thumbConfig) ?>" width="<?php echo $image->getThumbnailWidth($thumbConfig) ?>" height="<?php echo $image->getThumbnailHeight($thumbConfig) ?>"/><div class="menytitel"><?php wp_list_categories('include= . $cat . &style=none' ); ?></div></a></div>
    
          <?php endif ?>
    
        <?php endforeach ?>
    
    <?php endwhile; endif; ?>

    Thread Starter fhoto

    (@fhoto)

    Great! Don’t know if it’s the best way to fetch the post count, but it works a charm. Here’s what I used:

    <?php $count=0; ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php if ( in_category('6') && is_home() ) continue; ?>
    <?php $count++;?>
    <?php endwhile; ?>
    <?php else : ?>
    <?php endif; ?>
    
    <?php $total=$count*670; ?>
    <div id="bilder" style="width:<?php echo "$total"; ?>px;">
    
    //second loop here

    Excluded one category, got to test it some more once I get more of the site going. But as for now, this seems to do the trick. Already have two loops on the page though and I don’t know if this will interfere, but we’ll see.

    Thanks!

    Is there anyway to remove the title tag?

Viewing 4 replies - 1 through 4 (of 4 total)