Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter bobster

    (@bobster)

    Sorted it out now. Just included the code in the header.php file and seems to work out ok.

    bob

    bobster

    (@bobster)

    Hi Digipimp,

    This is what i got to work in my different cats.I stuck it in the sidebar.php file.

    <?php if (is_category()) {

    ?>
    Recent reviews with pics

    <?php
    $posts = get_posts('numberposts=5');
    foreach($posts as $post) :
    setup_postdata($post);
    ?>
    <div >
    <a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a>
    </div>
    <div align="left">
    <?php the_content('>>read more',true,''); ?>

    </div>
    <?php endforeach;

    I hope this helps a bit.

    cheers

    bob

    bobster

    (@bobster)

    Just an update: This works and displays the image,title and text of the post.
    However it displays all the text and I only want an extract. Hmmm any ideas:

    <div class="sidehead">
    Most recent reviews
    </div>
    <?php
    $posts = get_posts('numberposts=5');
    foreach($posts as $post) :
    setup_postdata($post);
    ?>
    <a>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a>
    <?php the_content(__('<br/> >>more ...')); ?>
    <?php endforeach; ?>

    I would have though that :
    <?php the_content(__('<br/> >>more ...')); ?>

    Would stop it at the read more tag but this is not the case. Any offers?

    Bob

    bobster

    (@bobster)

    Sorry, just to make clear.
    I am getting the same image and text repeated 5 times but five differnet post titles.

    ??

    bob

    bobster

    (@bobster)

    Hi again,

    This code kind of works, it gets different titles but the same image and text appears under the post title, any idea how I can:
    1. Match the title to the image and text
    2. limit the amount of text displayed
    3. limit the width of the image (ot so important for me as all small images )

    Here is the code so far:
    <div class=”sidehead”>
    Most recent with pics
    </div>
    <?php
    $archives = get_posts(‘numberposts=5’);
    foreach ($archives as $post) :
    ?>

    • “><?php the_title(); ?>
      <div class=”text”>
      <?php the_content(__(‘<br/> >>more info & places to buy…’)); ?>
      </div>
    • <?php endforeach; ?>

      Anyone give me a pointerS?

      Thanks
      bob

    bobster

    (@bobster)

    Hi Digipimp,
    Exactly what I am also after. I’ve seen it on https://www.i4u.com on the right hand side and looks great. If I get any joy will post solution.

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